Registered Member
|
I have question about ConjugateGradient with IncompleteCholesky on 3.3.4.
If I use IncompleteCholesky, it get crash. Eigen::ConjugateGradient< Eigen::SparseMatrix<double>, Eigen::Lower|Eigen::Upper, Eigen::IncompleteCholesky<double> > Solver; Solver.setMaxIterations(m_nMaxIterations); Solver.setTolerance(tolerance); Solver.compute(mat); Eigen::VectorXd prs = Solver.solve(rhs); It happens after compute. But the other Preconditioner works well. So, what is problem??? And I have another question about matrix. Even if I use uncompressed matrix, speed of solver is same. like this. Eigen::SparseMatrix<double> mat(x_size, x_size); mat.uncompress(); mat.setFromTriplets(triplets.begin(), triplets.end()); Eigen::ConjugateGradient< Eigen::SparseMatrix<double>, Eigen::Lower|Eigen::Upper > Solver; Solver.compute(mat); Eigen::VectorXd prs = Solver.solve(rhs); Why those speed is not change??? I imagine that compressed matrix should have more speed. thanks |
Moderator
|
setFromTriplets turns your matrix in compressed form, the uncompressed layout is only enabled for dynamic insertions. Anyway, both layout are equivalent in speed unless way too much memory has been reserved per column in the uncompressed mode.
Regarding IncompleteCholesky, make sure you compile with assertions on (i.e. without -DNDEBUG) and check for possible assertions and/or check that Solver.info()==Success after each call to the Solver. |
Registered Member
|
Thank you for your advice.
Actually, I got work with IncompleteCholesky. But in my case, it was almost 2x slower than the other preconditioner. (but number of iterate was reduced). Do you know something speed-up thing with it??? thanks |
Moderator
|
Have you tried the direct SimplicialLDLT<> solver? If you're working on a 2D domain it is likely to be faster. You might also try playing with the parameters of the IncompleteCholesky preconditioner; they allow to balance the precomputation cost wrt the number of required iterations.
|
Registered Member
|
I'm playing on 3D.
And I don't know why but I got crash SimplicialLDLT. Even if I fixed my matrix problem on IncompleteCholesky. thanks |
Moderator
|
It's likely a out-of-memory issue. If not, then the only way to help would be to save and share your matrix as explained there: http://eigen.tuxfamily.org/dox/group__T ... tml#title7, so that we can reproduce the crashes.
|
Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]