Commit 58b9e4a6 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'feature/reuse_matrix_pattern' into 'develop'

In the Eigen backend, the preconditioners and direct solvers might reuse the…

See merge request !60
parents a960cb29 5b74637f
Pipeline #1430 canceled with stage
......@@ -27,12 +27,17 @@ namespace AMDiS
: solver_{}
{
SolverConfig<LU>::init(prefix, solver_);
Parameters::get(prefix + "->reuse pattern", reusePattern_);
}
/// Implementes \ref RunnerInterface::init()
virtual void init(Matrix const& A) override
{
solver_.compute(A);
if (!reusePattern_ || !initialized_) {
solver_.analyzePattern(A);
initialized_ = true;
}
solver_.factorize(A);
test_exit(solver_.info() == Eigen::Success,
"Error in solver.compute(matrix)");
......@@ -60,5 +65,7 @@ namespace AMDiS
private:
LU solver_;
bool reusePattern_ = false;
bool initialized_ = false;
};
}
......@@ -22,13 +22,18 @@ namespace AMDiS
{
SolverCfg::init(prefix, solver_);
PreconCfg::init(prefix + "->precon", solver_.preconditioner());
Parameters::get(prefix + "->reuse pattern", reusePattern_);
}
/// Implementes \ref RunnerInterface::init()
virtual void init(Matrix const& A) override
{
solver_.compute(A);
if (!reusePattern_ || !initialized_) {
solver_.analyzePattern(A);
initialized_ = true;
}
solver_.factorize(A);
test_exit(solver_.info() == Eigen::Success,
"Error in solver.compute(matrix)");
......@@ -58,6 +63,8 @@ namespace AMDiS
private:
IterativeSolver solver_;
bool reusePattern_ = false;
bool initialized_ = false;
};
} // end namespace AMDiS
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment