mathnet-numerics
mathnet-numerics copied to clipboard
how to solve a left matrix division efficiently for a very large sparse matrix?
let's assume the following matrices a sparse matrix 'kk' 26400x26400 a vector 'fg' 26400x1 delta = kk\fg evaluating delta in matlab takes about ~0.8 seconds but as there is no left matrix division that i know of in Math.Net i tried to emulate in these ways 1 : delta = kk.Solve(fg); 2 : delta = kk.Inverse() * fg; but even after 3 whole minutes, it was still evaluating, so am i missing something here?
@bigworld12, I believe Math.Net doesn't provide any direct solvers for sparse matrices. It will try to solve it as a dense matrix which will take a very long time. I use CSparse.Net for sparse matrices (https://github.com/wo80/CSparse.NET/wiki/Math.NET-Numerics-and-CSparse)
(Have you tried the iterative solvers, i.e. SolveIterative?)
@cdrnet which one of them ? (the matrix is square and non-symmetric) @ajos6183 i already used that but it doesn't have UMFPACK so it gave poor performance with larger matrices compared to matlab
@bigworld12, I may be wrong but would this work? https://numerics.mathdotnet.com/api/MathNet.Numerics.LinearAlgebra.Double.Solvers/TFQMR.htm
Sorry for the necroing, but what is the suggested approach currently?