Reply to topic

Inverse of Sparse Matrix

User avatar mlimberger
Registered Member
Posts
9
Karma
0
OS

Inverse of Sparse Matrix

Tue Nov 13, 2012 12:03 pm
Hello.

I know, there are already two posts concerning this topic, but unfortunately they doesn't help on.
ALthough it is not recommended, I want to inverse a sparse matrix. In particular, I want to calculate
the covariance matrix from a given sparse normal equations matrix. For solving my least squares system
I use a cholesky decomposition and solve it for the unknowns. This works quite well.

Eigen::SparseMatrix A(n,n); //n=17495
Eigen::VectorXd b(n);
Ax = b;
Eigen::SimplicialCholesky<Eigen::SparseMatrix<double> > chol(A);
x = chol.solve(b);

But how to compute A^(-1) ???

Thank you in advance!
Marco
User avatar ggael
Moderator
Posts
2206
Karma
15
OS

Re: Inverse of Sparse Matrix  Topic is solved

Tue Nov 13, 2012 8:17 pm
call solve with a sparse matrix representing the identity matrix.
User avatar mlimberger
Registered Member
Posts
9
Karma
0
OS

Re: Inverse of Sparse Matrix

Thu Nov 15, 2012 10:02 am
Thank you! My approach was to use the Lower triangular matrix from the Cholesky LLT. But you are completely right, using the Identity matrix works fine!

Again, thanks!

 
Reply to topic

Bookmarks



Who is online

Registered users: AElfwine, alake, anditosan, Artmessiah, Baidu [Spider], Bing [Bot], edmael, Exabot [Bot], garthecho, geaplanet, Google [Bot], google01103, Horus, inksi, Joif, ken300, La Ninje, lazyit, pedrorodriguez, pvonz, thalesgava, tienhung, VP1986, Yahoo [Bot]