iMSTK
Interactive Medical Simulation Toolkit
Public Member Functions | Protected Attributes | List of all members
imstk::IterativeLinearSolver Class Reference

Base class for iterative linear solvers. More...

#include <imstkIterativeLinearSolver.h>

Inheritance diagram for imstk::IterativeLinearSolver:
Inheritance graph
[legend]
Collaboration diagram for imstk::IterativeLinearSolver:
Collaboration graph
[legend]

Public Member Functions

virtual void setMaxNumIterations (const size_t maxIter)
 Do one iteration of the method. More...
 
virtual size_t getMaxNumIterations () const
 
virtual const Vectord & getResidualVector ()
 Return residual vector.
 
virtual const Vectord & getResidualVector (const Vectord &x)
 
virtual double getResidual (const Vectord &x)
 Return residue in 2-norm.
 
void print () const override
 Print solver information.
 
virtual void solve (Vectord &x) override
 Solve the linear system using Gauss-Seidel iterations.
 
bool isIterative () const override
 Returns true if the solver is iterative.
 
- Public Member Functions inherited from imstk::LinearSolver< SparseMatrixd >
 LinearSolver ()
 Default constructor/destructor.
 
virtual void setSystem (std::shared_ptr< LinearSystemType > newSystem)
 Set/get the system. Replaces/Returns the stored linear system of equations.
 
std::shared_ptr< LinearSystemTypegetSystem () const
 
void setTolerance (const double tolerance)
 Set solver tolerance.
 
double getTolerance () const
 Get solver tolerance.
 
Type getType ()
 Return the type of the solver.
 

Protected Attributes

size_t m_maxIterations = 100
 Maximum number of iterations to be performed.
 
Vectord m_residual
 Storage for residual vector.
 
- Protected Attributes inherited from imstk::LinearSolver< SparseMatrixd >
Type m_type
 Type of the scene object.
 
double m_tolerance
 default tolerance
 
std::shared_ptr< LinearSystemTypem_linearSystem
 Linear system of equations.
 

Additional Inherited Members

- Public Types inherited from imstk::LinearSolver< SparseMatrixd >
enum  Type
 
using MatrixType = SparseMatrixd
 
using LinearSystemType = LinearSystem< MatrixType >
 

Detailed Description

Base class for iterative linear solvers.

Definition at line 18 of file imstkIterativeLinearSolver.h.

Member Function Documentation

◆ setMaxNumIterations()

void imstk::IterativeLinearSolver::setMaxNumIterations ( const size_t  maxIter)
virtual

Do one iteration of the method.

set/get the maximum number of iterations for the iterative solver.

Reimplemented in imstk::SOR, imstk::GaussSeidel, imstk::Jacobi, and imstk::ConjugateGradient.

Definition at line 14 of file imstkIterativeLinearSolver.cpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: