是否有可能通过 ilnumerics 得到矩阵 A 的 Moore-Penrose 广义逆? pinv 在 ilnumerics 中是什么意思? pinv 表示逆矩阵?
最佳答案
是的,使用 ILNumerics 是可能的!
这是一个注释示例:
// Matrix A
ILArray<double> A = new double[,] { { 1, 2 }, { 3, 4 } };
// The Moore-Penrose pseudoinverse
ILArray<double> Ainv = pinv(A);
// Check for: A * A^-1 = I
ILArray<double> AtimesAinv = multiply(A, Ainv);
// difference of I = eye(2,2) - the inverse
ILArray<double> diff = eye(2, 2) - AtimesAinv;
// max norm of the difference
double normalized = (double)norm(diff)[0];
// Arbitrary epsilon to make the comparison
double epsilon = 1e-10;
Assert.AreEqual(true, normalized <= epsilon);
请查看以下链接中的文档以获取更多信息:ILNumerics API Doc - pinv .
关于c# - 如何通过 ilnumerics 获得 Moore-Penrose 广义逆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28036641/