This forum has been archived. All content is frozen. Please use KDE Discuss instead.

SparseMatrix / Cholmod fails after Eigen2 -> Eigen3

Tags: None
(comma "," separated)
malexa
Registered Member
Posts
1
Karma
0
OS
Hi,

I used Cholmod for solving Sparse LSE in EIgen2 and it worked fine. Now, after upgrading the factorization consistently fails, without any other error message. Here is the code:

Code: Select all
   SparseMatrix<double> A(nv,nv);
   for (int i = 0; i < nv; i++) {
      A.startVec(i);
//      for (int j = i; j < nv; j++) {
      for (int j = 0; j < nv; j++) {
         if (i==j)
            A.insertBack(i,i) = 1.0 - lambda*L.coeff(i,i);
         else if (L.coeff(j,i) > 0)
            A.insertBack(j,i) = -lambda*L.coeff(j,i);         
      }
   }
   A.finalize();
...
//   cout << A << "\n\n";
//   MatrixXf dA(A);
//   FullPivLU<MatrixXf> lu(dA);
//   cout << lu.dimensionOfKernel() << "\n\n";
   SparseLLT<SparseMatrix<double> ,Cholmod> sllt(A);
//   SparseLLT<SparseMatrix<float> > sllt(A);
   if (sllt.succeeded()) {
      cout << "Factorization succeeded\n";
      sllt.solveInPlace(X);
   }
   else {
      cout << "Factorization failed\n";
//      X = lu.solve(X);
   }


As you can see, I checked the matrix using methods for dense types. I also tried assigning only the lower triangle. Is there anything that changed in the backend of sparse matrices / Cholmod from Eigen2 to Eigen3 that I should be aware of?

Thanks!
-Marc
rbossart
Registered Member
Posts
14
Karma
0
Hi,

You can try the latest rev. Don't forget to include Eigen/CholmodSupport from /usr/include/eigen/unsupported. There is also the new solve() method. An example is given in the unit tests. Depending on your problem, you could also try an LDLT, Cholmod support has also been added.

BTW, Taucs support has just been removed. See Gael comment on this. To me, removing taucs is not surprising as Taucs is not actively maintained (last updates date back to 2003), and I saw here and there that it is notoriously slower than more modern solvers like Cholmod for instance.

Cheers,
Romain


rbossart, proud to be a member of KDE forums since 2008-Dec.


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]