SurgSim::Math::LinearSparseSolveAndInverse Class Referenceabstract

LinearSparseSolveAndInverse aims at performing an efficient linear system resolution and calculating its inverse matrix at the same time. More...

`#include <SurgSim/Math/LinearSparseSolveAndInverse.h>`

Inheritance diagram for SurgSim::Math::LinearSparseSolveAndInverse:

## Public Member Functions

virtual | ~LinearSparseSolveAndInverse ()
virtual void | setMatrix (const SparseMatrix &matrix)=0
| Set the linear solver matrix. More...
virtual Matrix | solve (const Matrix &b) const =0
| Solve the linear system (matrix.x=b) using the matrix provided by the latest setMatrix call for all columns of the rhs matrix b. More...
virtual Matrix | getInverse () const

## Protected Attributes

SparseMatrix | m_matrix
| A copy of the system matrix for use when an inverse is necessary. More...

## Detailed Description

LinearSparseSolveAndInverse aims at performing an efficient linear system resolution and calculating its inverse matrix at the same time.

This class is very useful in the OdeSolver resolution to improve performance.

See also
  SurgSim::Math::OdeSolver

## Constructor & Destructor Documentation

## ~LinearSparseSolveAndInverse()

virtual SurgSim::Math::LinearSparseSolveAndInverse::~LinearSparseSolveAndInverse | ( |  | ) |

inline virtual

## Member Function Documentation

## getInverse()

Matrix SurgSim::Math::LinearSparseSolveAndInverse::getInverse | ( |  | ) | const

virtual

Returns
  The linear system's inverse matrix, i.e. the inverse of the matrix provided on the last setMatrix call

## setMatrix()

virtual void SurgSim::Math::LinearSparseSolveAndInverse::setMatrix | ( | const SparseMatrix & | matrix | ) |

pure virtual

Set the linear solver matrix.

Parameters

  matrix | the new matrix to solve/inverse for

Implemented in SurgSim::Math::LinearSparseSolveAndInverseCG, and SurgSim::Math::LinearSparseSolveAndInverseLU.

## solve()

virtual Matrix SurgSim::Math::LinearSparseSolveAndInverse::solve | ( | const Matrix & | b | ) | const

pure virtual

Solve the linear system (matrix.x=b) using the matrix provided by the latest setMatrix call for all columns of the rhs matrix b.

Parameters

  b | The rhs matrix

Returns
  The solution matrix

Implemented in SurgSim::Math::LinearSparseSolveAndInverseCG, and SurgSim::Math::LinearSparseSolveAndInverseLU.

## Member Data Documentation

## m_matrix

SparseMatrix SurgSim::Math::LinearSparseSolveAndInverse::m_matrix

protected

A copy of the system matrix for use when an inverse is necessary.

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

- SurgSim/Math/LinearSparseSolveAndInverse.h
- SurgSim/Math/LinearSparseSolveAndInverse.cpp