numpy - Fast algorithm for computing cofactor matrix
问题描述
I wonder if there is a fast algorithm, say (O(n^3)) for computing the cofactor matrix (or conjugate matrix) of a N*N square matrix. And yes one could first compute its determinant and inverse separately and then multiply them together. But how about this square matrix is non-invertible?
I am curious about the accepted answer here:Speed up python code for computing matrix cofactors
What would it mean by "This probably means that also for non-invertible matrixes, there is some clever way to calculate the cofactor (i.e., not use the mathematical formula that you use above, but some other equivalent definition)."?
解决方案
分解 M = L x D x U,其中L
是下三角形,主对角线上有一个,是主对角线U
上的上三角形,并且D
是对角线。
您可以使用与 Cholesky 分解类似的反向替换。然后,
M^{ -1 } = U^{ -1 } x D^{ -1 } x L^{ -1 }
然后将辅因子矩阵转置为:
Cof( M )^T = Det( U ) x Det( D ) x Det( L ) x M^{ -1 }。
如果M
是单数或几乎是单数,则 的一个(或多个)元素D
将为零或几乎为零。用矩阵乘积中的零和行列式中的 1 替换这些元素,并将上述等式用于转置辅因子矩阵。
推荐阅读
- javascript - 选择并单击 td 时如何在 td 内的字段中插入当前完整日期和日期
- javascript - 在创建事件中动态设置 jQuery ui 滑块值
- sql-server - 我已经估计了工作时间,但是当我添加员工(在本例中为 2)的小时数时,它会重复估计的时间
- linux - crontab 错误:“/tmp/crontab.calJpk”:5:糟糕的日期
- java - 对于同一类的所有实例,自动生成的 serialVersionUID 是否始终相同?
- angular - IONIC-4 使用
在拆分窗格的侧边菜单中 - python - sagemaker 中的 protobuf 问题
- express - 在 JWT 中,sign() 方法
- c++ - 在包装器中保存抽象值对象和继承的使用
- angular - 是否有一些示例可以在一个命令中在 Angular 7 上创建 ngrx/Store