This project has moved. For the latest updates, please go here.

Direct sparse solver

Mar 29, 2011 at 6: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.

John

 

>

Mar 30, 2011 at 1:14 PM
Edited Mar 30, 2011 at 1: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.

Marcus

Mar 30, 2011 at 3:47 PM

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

John