Skip to content
Snippets Groups Projects
Commit 7b1de22e authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MaL] Compress eigen matrix before solve.

parent ee3f3951
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,8 @@ public: ...@@ -37,6 +37,8 @@ public:
void solve(EigenVector::RawVectorType &b, EigenVector::RawVectorType &x, EigenOption &/*opt*/) override void solve(EigenVector::RawVectorType &b, EigenVector::RawVectorType &x, EigenOption &/*opt*/) override
{ {
INFO("-> solve"); INFO("-> solve");
if (!_A.isCompressed())
_A.makeCompressed();
_solver.compute(_A); _solver.compute(_A);
if(_solver.info()!=Eigen::Success) { if(_solver.info()!=Eigen::Success) {
ERR("Failed during Eigen linear solver initialization"); ERR("Failed during Eigen linear solver initialization");
...@@ -70,6 +72,8 @@ public: ...@@ -70,6 +72,8 @@ public:
INFO("-> solve"); INFO("-> solve");
_solver.setTolerance(opt.error_tolerance); _solver.setTolerance(opt.error_tolerance);
_solver.setMaxIterations(opt.max_iterations); _solver.setMaxIterations(opt.max_iterations);
if (!_A.isCompressed())
_A.makeCompressed();
_solver.compute(_A); _solver.compute(_A);
if(_solver.info()!=Eigen::Success) { if(_solver.info()!=Eigen::Success) {
ERR("Failed during Eigen linear solver initialization"); ERR("Failed during Eigen linear solver initialization");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment