[eigen] Using UmfPackLU with sparse RHS

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi,
I try to use Eigen's interface to UmfPack. The documentation claims that UmfPackLU can solve linear equations with a dense or sparse right hand side.

[quote]
This class allows to solve for A.X = B sparse linear problems via a LU factorization using the UmfPack library.
The sparse matrix A must be squared and full rank.
The vectors or matrices X and B can be either dense or sparse.
[\quote]

However the following code does not compile for me (with g++ 4.6.1 and eigen 3.2.1)
#include <eigen3/Eigen/UmfpackSupport>

int main(){
    Eigen::SparseMatrix<double> M(10,10);
    Eigen::SparseMatrix<double> B(10,10);     // does not compile
    //Eigen::MatrixXd B(10,10);                       // compiles
    Eigen::UmfPackLU<Eigen::SparseMatrix<double> > solver(M);
    solver.solve(B);
    return 0;
}

Is this a bug ? or could you please explain how I should proceed ?
By the way, are sparse matrices convertible to dense ones ?
Greetings,
Alain Dequidt
-- 
Alain DEQUIDT
+33 (0) 4 73 40 71 94

Maître de Conférences
Université Blaise Pascal Clermont II, ICCF
Chimie 7
24 avenue des landais
63171 Aubiere Cedex


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/