![]() |
Derivation for tri-diagonal block matrix type. More...
#include <SurgSim/Math/LinearSolveAndInverse.h>
Public Member Functions | |
void | setMatrix (const Matrix &matrix) override |
Set the linear solver matrix. More... | |
Vector | solve (const Vector &b) override |
Solve the linear system (matrix.x=b) using the matrix provided by the latest setMatrix call. More... | |
Matrix | getInverse () override |
![]() | |
virtual | ~LinearSolveAndInverse () |
Protected Member Functions | |
void | inverseTriDiagonalBlock (const SurgSim::Math::Matrix &A, SurgSim::Math::Matrix *inv, bool isSymmetric=false) |
Computes the inverse matrix. More... | |
Protected Attributes | |
Matrix | m_inverse |
Member variable to hold the inverse matrix in case only the solving is requested. More... | |
Private Types | |
typedef Eigen::Matrix< Matrix::Scalar, BlockSize, BlockSize, Matrix::Options > | Block |
Private Member Functions | |
const Eigen::Block< const Matrix, BlockSize, BlockSize > | minusAi (const SurgSim::Math::Matrix &A, size_t i) const |
Gets a lower-diagonal block element (named -Ai in the algorithm) More... | |
const Eigen::Block< const Matrix, BlockSize, BlockSize > | Bi (const SurgSim::Math::Matrix &A, size_t i) const |
Gets a diagonal block element (named Bi in the algorithm) More... | |
const Eigen::Block< const Matrix, BlockSize, BlockSize > | minusCi (const SurgSim::Math::Matrix &A, size_t i) const |
Gets a upper-diagonal block element (named -Ci in the algorithm) More... | |
Private Attributes | |
std::vector< Block > | m_Di |
std::vector< Block > | m_Ei |
std::vector< Block > | m_Bi_AiDiminus1_inv |
Derivation for tri-diagonal block matrix type.
BlockSize | Define the block size of the tri-diagonal block matrix |
|
private |
|
private |
Gets a diagonal block element (named Bi in the algorithm)
A | The matrix on which to retrieve the diagonal block element |
i | The line index on which to retrieve the diagonal block element |
|
overridevirtual |
Implements SurgSim::Math::LinearSolveAndInverse.
|
protected |
Computes the inverse matrix.
A | The matrix to inverse | |
[out] | inv | The inverse matrix |
isSymmetric | True if the matrix is symmetric, False otherwise |
|
private |
Gets a lower-diagonal block element (named -Ai in the algorithm)
A | The matrix on which to retrieve the lower-diagonal block element |
i | The line index on which to retrieve the lower-diagonal block element |
|
private |
Gets a upper-diagonal block element (named -Ci in the algorithm)
A | The matrix on which to retrieve the upper-diagonal block element |
i | The line index on which to retrieve the upper-diagonal block element |
|
overridevirtual |
Set the linear solver matrix.
matrix | the new matrix to solve/inverse for |
Implements SurgSim::Math::LinearSolveAndInverse.
Reimplemented in SurgSim::Math::LinearSolveAndInverseSymmetricTriDiagonalBlockMatrix< BlockSize >.
|
overridevirtual |
Solve the linear system (matrix.x=b) using the matrix provided by the latest setMatrix call.
b | The rhs vector |
Implements SurgSim::Math::LinearSolveAndInverse.
|
private |
Intermediate block matrices, helpful to construct the inverse matrix
|
private |
Intermediate block matrices, helpful to construct the inverse matrix
|
private |
Intermediate block matrices, helpful to construct the inverse matrix
|
protected |
Member variable to hold the inverse matrix in case only the solving is requested.