c++ - 如何将矩阵因式分解为核矩阵的乘积?

标签 c++ math matrix linear-algebra

问题陈述:

Say we have a set of kernel square matrices = {K1, K2, .., Kn}. Given a matrix A find the product involving the least amount of matrix multiplications which gives: A = Ki * Kj * ... * Kz

例子:

Say we have these two matrices in the set of Kernel matrices:
K1 = (1 2)    K2 = (5 6)
     (3 4)         (7 8)

Then we have a solution for A=K1*K2=(19 22) and also for B=K1*K1*K2=(105 122)
                                    (43 50)                         (229 266)

是否有任何现有的 C 或 C++ 库可供我用来寻找解决方案?如果没有,是否有任何已知的算法/启发式方法?

附言这不是家庭作业问题或理论问题或其他一些麻烦的事情。这是我在日常工作中从事的副业项目需要解决的实际问题。

最佳答案

您可能会查看矩阵的迹和行列式。由于可以比完全乘法更有效地计算乘积的迹和行列式,因此它们可以帮助您有效地排除组合。

http://en.wikipedia.org/wiki/Trace_(linear_algebra)#Trace_of_a_product http://en.wikipedia.org/wiki/Determinant#Multiplicativity_and_matrix_groups

关于c++ - 如何将矩阵因式分解为核矩阵的乘积?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10794850/

相关文章:

c++ - 在 move 之前获取右值引用的地址是否安全?

C++ 一个类只能被另一个类使用

algorithm - 当我想选择项目以尽可能满地填充容器时,它叫什么 - 我应该使用什么算法?

Java - 即使小数位数低于 5,也要向上舍入

当在循环内使用计数器时 C++ 程序崩溃

python 列表列表插入换行符

C++ - 允许通过基类(接口(interface))访问,禁止通过派生类(具体实现)访问?

c++ - 如何检查 DLL 的信息

python - Numpy.dot() 尺寸未对齐

java - 矩阵相加法。双数组。 java