![]() |
Derivation for tri-diagonal block matrix type. More...
#include <SurgSim/Math/LinearSolveAndInverse.h>
Public Member Functions | |
virtual void | operator() (const Matrix &A, const Vector &b, Vector *x=nullptr, Matrix *Ainv=nullptr) override |
Solve a linear system A.x=b and compute the matrix A^-1. More... | |
![]() | |
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 |
|
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 |
Solve a linear system A.x=b and compute the matrix A^-1.
A | Linear system matrix | |
b | Linear system right-hand-side | |
[out] | x | Linear system unknown (if requested) |
[out] | Ainv | Linear system matrix inverse = A^-1 (if requested) |
Implements SurgSim::Math::LinearSolveAndInverse.
Reimplemented in SurgSim::Math::LinearSolveAndInverseSymmetricTriDiagonalBlockMatrix< BlockSize >.
|
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.