7 #include "imstkDirectLinearSolver.h" 8 #include "imstkLogger.h" 12 DirectLinearSolver<Matrixd>::
13 DirectLinearSolver(
const Matrixd& matrix,
const Vectord& b)
15 m_linearSystem = std::make_shared<LinearSystem<Matrixd>>(matrix, b);
16 m_solver.compute(matrix);
21 setSystem(std::shared_ptr<LinearSystem<Matrixd>> newSystem)
24 m_solver.compute(m_linearSystem->getMatrix());
30 m_linearSystem = std::make_shared<LinearSystem<SparseMatrixd>>(matrix, b);
31 m_solver.compute(matrix);
39 m_solver.compute(m_linearSystem->getMatrix());
47 LOG(FATAL) <<
"Linear system has not been set";
49 x = m_solver.solve(rhs);
57 LOG(FATAL) <<
"Linear system has not been set";
61 auto b = m_linearSystem->getRHSVector();
62 x = m_solver.solve(b);
70 LOG(FATAL) <<
"Linear system has not been set";
72 x = m_solver.solve(rhs);
80 LOG(FATAL) <<
"Linear system has not been set";
84 auto b = m_linearSystem->getRHSVector();
85 x = m_solver.solve(b);
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrixd
A dynamic size matrix of doubles.
Represents the linear system of the form .
Dense direct solvers. Solves a dense system of equations using Cholesky decomposition.
void setSystem(std::shared_ptr< LinearSystemType > newSystem) override
Sets the system. System of linear equations.
virtual void setSystem(std::shared_ptr< LinearSystemType > newSystem)
Set/get the system. Replaces/Returns the stored linear system of equations.
DirectLinearSolver()=default
Default constructor/destructor.