16 #ifndef SURGSIM_MATH_LINEARSOLVEANDINVERSE_H 17 #define SURGSIM_MATH_LINEARSOLVEANDINVERSE_H 65 template <
int BlockSize>
83 static_assert(BlockSize > 0,
84 "Cannot define a tri-diagonal block matrix with block size 0 or negative");
86 typedef Eigen::Matrix<Matrix::Scalar, BlockSize, BlockSize, Matrix::Options>
Block;
92 const Eigen::Block<const Matrix, BlockSize, BlockSize> minusAi(
const SurgSim::Math::Matrix& A,
size_t i)
const;
98 const Eigen::Block<const Matrix, BlockSize, BlockSize> Bi(
const SurgSim::Math::Matrix& A,
size_t i)
const;
104 const Eigen::Block<const Matrix, BlockSize, BlockSize> minusCi(
const SurgSim::Math::Matrix& A,
size_t i)
const;
108 std::vector<Block> m_Di,
m_Ei, m_Bi_AiDiminus1_inv;
117 template <
int BlockSize>
134 #endif // SURGSIM_MATH_LINEARSOLVEANDINVERSE_H Derivation for dense matrix type.
Definition: LinearSolveAndInverse.h:50
Definition: DriveElementFromInputBehavior.cpp:27
LinearSolveAndInverse aims at performing an efficient linear system resolution and calculating its in...
Definition: LinearSolveAndInverse.h:36
virtual void operator()(const Matrix &A, const Vector &b, Vector *x=nullptr, Matrix *Ainv=nullptr)=0
Solve a linear system A.x=b and compute the matrix A^-1.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dynamic size matrix.
Definition: Matrix.h:65
virtual ~LinearSolveAndInverse()
Definition: LinearSolveAndInverse.h:39
Derivation for symmetric tri-diagonal block matrix type.
Definition: LinearSolveAndInverse.h:118
Derivation for diagonal matrix type.
Definition: LinearSolveAndInverse.h:57
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
A dynamic size column vector.
Definition: Vector.h:67
std::vector< Block > m_Ei
Definition: LinearSolveAndInverse.h:108
Matrix m_inverse
Member variable to hold the inverse matrix in case only the solving is requested. ...
Definition: LinearSolveAndInverse.h:80
Definitions of small fixed-size square matrix types.
The header that provides the assertion API.
Definitions of small fixed-size vector types.
Eigen::Matrix< Matrix::Scalar, BlockSize, BlockSize, Matrix::Options > Block
Definition: LinearSolveAndInverse.h:84
Derivation for tri-diagonal block matrix type.
Definition: LinearSolveAndInverse.h:66