• geninv(A) - 返回 L,即矩阵 A 的广义 (伪) 逆矩阵,它给出了方程组的最小二乘解。如果 x = L · b,那么 x 是 |A·x − b|2 的最小值。如果 A 为非奇异方阵,则 geninv 返回转置矩阵 A-1。
如果 A 具有满秩 (所有列线性无关),则 geninv 返回 L,A 的左逆阵,即 L · A = I。在这种情况下,L = (AT · A)-1 · AT。
由于 geninv 函数取决于 TOL,因此对于近似奇异矩阵,调整该值可能会得到更优的结果。
geninv 函数基于 Nash, J.C 的 Compact Numerical Methods for Computers: Linear Algebra and Functional Minimization 一书 (John Wiley & Sons, New York, 1979) 中的一个例程。