This project has moved and is read-only. For the latest updates, please go here.

Direct sparse solver

Mar 29, 2011 at 7:33 PM

I'm new (today) to Math.NET Numerics, so pardon any ignorance on my part.

I'm trying to solve Ax=b using a direct solver, where A is a sparse matrix.  I have A stored in a SparseMatrix.  I can see that there's a generic solver Isolver<> that appears to take a RHS vector as an argument and returns the solution vector, but not clear what A matrix it operates on?  Couldn't find an example of how to use a direct solver.  Any hints or pointers would be greatly appreciated, thanks.




Mar 30, 2011 at 2:14 PM
Edited Mar 30, 2011 at 2:15 PM

Hi John,

In the Examples project, take a look at  Examples.LinearAlgebra.DirectSolvers. It goes roughly:

var A = new SparseMatrix(...);
var b = new SparseVector(...);
var x = A.QR.Solve(b); // you can replace QR with LU, Cholesky, or SVD.

Note that the direct solvers have not been optimized for sparse matrices.


Mar 30, 2011 at 4:47 PM

Got it, thanks a lot for pointing me in the right direction, Marcus!