Go to the documentation of this file.
16 #ifndef SURGSIM_MATH_LINEARSOLVEANDINVERSE_H
17 #define SURGSIM_MATH_LINEARSOLVEANDINVERSE_H
83 template <
size_t BlockSize>
108 typedef Eigen::Matrix<Matrix::Scalar, BlockSize, BlockSize, Matrix::Options>
Block;
136 template <
size_t BlockSize>
153 #endif // SURGSIM_MATH_LINEARSOLVEANDINVERSE_H
std::vector< Block > m_Di
Definition: LinearSolveAndInverse.h:130
void inverseTriDiagonalBlock(const SurgSim::Math::Matrix &A, SurgSim::Math::Matrix *inv, bool isSymmetric=false)
Computes the inverse matrix.
Definition: LinearSolveAndInverse-inl.h:49
void setMatrix(const Matrix &matrix) override
Set the linear solver matrix.
Definition: LinearSolveAndInverse.cpp:24
Eigen::PartialPivLU< typename Eigen::MatrixBase< Matrix >::PlainObject > m_luDecomposition
Definition: LinearSolveAndInverse.h:64
Derivation for tri-diagonal block matrix type.
Definition: LinearSolveAndInverse.h:84
Derivation for diagonal matrix type.
Definition: LinearSolveAndInverse.h:68
Vector m_inverseDiagonal
Definition: LinearSolveAndInverse.h:71
virtual void setMatrix(const Matrix &matrix)=0
Set the linear solver matrix.
Vector solve(const Vector &b) override
Solve the linear system (matrix.x=b) using the matrix provided by the latest setMatrix call.
Definition: LinearSolveAndInverse-inl.h:161
Derivation for symmetric tri-diagonal block matrix type.
Definition: LinearSolveAndInverse.h:137
std::vector< Block > m_Ei
Definition: LinearSolveAndInverse.h:130
Definition: CompoundShapeToGraphics.cpp:29
virtual ~LinearSolveAndInverse()
Definition: LinearSolveAndInverse.h:38
virtual Vector solve(const Vector &b)=0
Solve the linear system (matrix.x=b) using the matrix provided by the latest setMatrix call.
Matrix getInverse() override
Definition: LinearSolveAndInverse.cpp:36
Derivation for dense matrix type.
Definition: LinearSolveAndInverse.h:54
Vector solve(const Vector &b) override
Solve the linear system (matrix.x=b) using the matrix provided by the latest setMatrix call.
Definition: LinearSolveAndInverse.cpp:31
void setMatrix(const Matrix &matrix) override
Set the linear solver matrix.
Definition: LinearSolveAndInverse-inl.h:155
void setMatrix(const Matrix &matrix) override
Set the linear solver matrix.
Definition: LinearSolveAndInverse-inl.h:173
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)
Definition: LinearSolveAndInverse-inl.h:29
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
A dynamic size column vector.
Definition: Vector.h:68
LinearSolveAndInverse aims at performing an efficient linear system resolution and calculating its in...
Definition: LinearSolveAndInverse.h:35
Vector solve(const Vector &b) override
Solve the linear system (matrix.x=b) using the matrix provided by the latest setMatrix call.
Definition: LinearSolveAndInverse.cpp:48
Matrix m_inverse
Member variable to hold the inverse matrix in case only the solving is requested.
Definition: LinearSolveAndInverse.h:105
Eigen::Matrix< Matrix::Scalar, BlockSize, BlockSize, Matrix::Options > Block
Definition: LinearSolveAndInverse.h:108
virtual Matrix getInverse()=0
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)
Definition: LinearSolveAndInverse-inl.h:43
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dynamic size matrix.
Definition: Matrix.h:65
Matrix getInverse() override
Definition: LinearSolveAndInverse.cpp:53
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)
Definition: LinearSolveAndInverse-inl.h:36
void setMatrix(const Matrix &matrix) override
Set the linear solver matrix.
Definition: LinearSolveAndInverse.cpp:41
Matrix getInverse() override
Definition: LinearSolveAndInverse-inl.h:167
std::vector< Block > m_Bi_AiDiminus1_inv
Definition: LinearSolveAndInverse.h:130