使用 SuperLU 等稀疏求解器在 fortran 中求逆矩阵
好的,我想使用非对称密集矩形矩阵的矩阵逆来比较结果。 通常使用 DGETRF 和 DGETRI Blas 来获取矩阵逆。 假设 [2000x2000] 双精度矩阵 A,我想求解找到矩阵 - 逆矩阵。
然后我得到了 SuperLU 解算器。 使用稀疏求解器获得逆矩阵的想法是求解 A*X=I,其中 I 是单位矩阵。如果有解,X就是逆矩阵。因此,如果 A[2000x2000],Ainvers 又名 X[2000x2000],恒等式 I[2000x2000]
而在 fortran 中调用 superlu lib 的输入
call c_fortran_dgssv ( iopt, n, ncc, nrhs, acc, icc,ccc, b, ldb, factors, info )
Ok i want to compare the result using inverse of matrix for dense rectangular matrix non symmetric.
Usually using DGETRF and DGETRI Blas for get the matrix inverse.
Let say [2000x2000] double precision matrix A, i want to solve to find the matrix - inverse.
And then i got the SuperLU solver.
The idea using sparse solver to get inverse matrix, is to solve A*X=I, where I is the identity matrix. If there is a solution, X will be the inverse matrix. So if the A[2000x2000], Ainvers aka X[2000x2000], identity I[2000x2000]
While the input for calling superlu lib in fortran
call c_fortran_dgssv ( iopt, n, ncc, nrhs, acc, icc,ccc, b, ldb, factors, info )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
superlu 中的 B 可以是 (nxn) 矩阵,
A * B = x
如果输入A(nxn),则A的逆矩阵是B(nxn),以x(nxn)为单位矩阵,则所有B和X应该是(nxn)。
或者使用 B(n) 作为一维矩阵以节省内存。
正如弗拉基米尔指出的那样。 A 矩阵每列的执行次数
B in superlu can be (n x n) matrices,
A * B = x
if A (n x n) input, then inverse A is B (n x n) with x (n x n) as identity matrix, then all B, and X should be (n x n).
Alternatively using B (n) as 1 dimensional matrix for saving memory.
as Vladimir pointed out. Do per column of A matrix