9 #include "imstkNonLinearSystem.h" 10 #include "imstkIterativeLinearSolver.h" 12 #include <Eigen/IterativeLinearSolvers> 16 class LinearProjectionConstraint;
26 SOR(
const double relaxationFactor = 0.5) : m_relaxationFactor(relaxationFactor) {
m_type = Type::SuccessiveOverRelaxation; };
27 SOR(
const SparseMatrixd& A,
const Vectord& rhs);
28 ~
SOR()
override =
default;
35 SOR& operator=(
const SOR&) =
delete;
36 SOR& operator=(
const SOR&&) =
delete;
51 void solve(Vectord& x)
override;
57 void solve(Vectord& x,
const double tolerance);
67 void setSystem(std::shared_ptr<LinearSystemType> newSystem)
override;
82 void print()
const override;
94 m_FixedLinearProjConstraints = f;
102 return *m_FixedLinearProjConstraints;
110 m_DynamicLinearProjConstraints = f;
118 return *m_DynamicLinearProjConstraints;
122 double m_relaxationFactor = 0.5;
124 std::vector<LinearProjectionConstraint>* m_FixedLinearProjConstraints =
nullptr;
125 std::vector<LinearProjectionConstraint>* m_DynamicLinearProjConstraints =
nullptr;
Base class for iterative linear solvers.
void solve(Vectord &x) override
Solve the system of equations.
std::vector< LinearProjectionConstraint > & getLinearProjectors()
Get the vector denoting the filter.
void setTolerance(const double tolerance)
Set solver tolerance.
std::vector< LinearProjectionConstraint > & getDynamicLinearProjectors()
Get the vector denoting the filter.
double getRelaxationFactor() const
Return the relaxation factor.
void setDynamicLinearProjectors(std::vector< LinearProjectionConstraint > *f)
Get the vector denoting the filter.
void print() const override
Print solver information.
double getResidual(const Vectord &x) override
Return the error calculated by the solver.
void SORSolve(Vectord &x)
Do one iteration of the method.
Type m_type
Type of the scene object.
void setLinearProjectors(std::vector< LinearProjectionConstraint > *f)
Get the vector denoting the filter.
void setMaxNumIterations(const size_t maxIter) override
set/get the maximum number of iterations for the iterative solver.
Successive Over Relaxation (SOR) sparse linear solver.
void setSystem(std::shared_ptr< LinearSystemType > newSystem) override
Sets the system. System of linear equations.