version 0.4
Ikarus::LinearSolverTemplate< ScalarType > Class Template Reference

A type-erased class which wraps most of the linear solvers available in Eigen. More...

#include <ikarus/solver/linearsolver/linearsolver.hh>

Inheritance diagram for Ikarus::LinearSolverTemplate< ScalarType >:
[legend]

Public Types

using SparseMatrixType = Eigen::SparseMatrix< ScalarType >
 
using DenseMatrixType = Eigen::MatrixX< ScalarType >
 

Public Member Functions

 LinearSolverTemplate (const SolverTypeTag &p_solverTypeTag)
 Constructor for LinearSolverTemplate. More...
 
 ~LinearSolverTemplate ()=default
 Destructor for LinearSolverTemplate. More...
 
LinearSolverTemplateoperator= (const LinearSolverTemplate &other)
 Copy assignment operator. More...
 
 LinearSolverTemplate (const LinearSolverTemplate &other)
 Copy constructor. More...
 
 LinearSolverTemplate (LinearSolverTemplate &&other) noexcept=default
 Move constructor. More...
 
LinearSolverTemplateoperator= (LinearSolverTemplate &&other) noexcept=default
 Move assignment operator. More...
 
template<typename MatrixType >
requires std::is_same_v<MatrixType, DenseMatrixType> || std::is_same_v<MatrixType, SparseMatrixType>
LinearSolverTemplatecompute (const MatrixType &A)
 Compute the factorization of the matrix. More...
 
template<typename MatrixType >
requires std::is_same_v<MatrixType, DenseMatrixType> || std::is_same_v<MatrixType, SparseMatrixType>
void analyzePattern (const MatrixType &A)
 Analyze the pattern of the matrix. More...
 
template<typename MatrixType >
requires std::is_same_v<MatrixType, DenseMatrixType> || std::is_same_v<MatrixType, SparseMatrixType>
void factorize (const MatrixType &A)
 Factorize the matrix. More...
 
void solve (Eigen::VectorX< ScalarType > &x, const Eigen::VectorX< ScalarType > &b)
 Solve the linear system for a vector. More...
 
void solve (Eigen::MatrixX3< ScalarType > &x, const Eigen::MatrixX3< ScalarType > &b)
 Solve the linear system for a n times 3 matrix. More...
 
void solve (Eigen::MatrixX2< ScalarType > &x, const Eigen::MatrixX2< ScalarType > &b)
 Solve the linear system for a n times 2 matrix. More...
 
void solve (Eigen::MatrixX< ScalarType > &x, const Eigen::MatrixX< ScalarType > &b)
 Solve the linear system for a n times n matrix. More...
 

Detailed Description

template<typename ScalarType = double>
class Ikarus::LinearSolverTemplate< ScalarType >
Template Parameters
ScalarTypeThe scalar type of the linear system (default: double).

Member Typedef Documentation

◆ DenseMatrixType

template<typename ScalarType = double>
using Ikarus::LinearSolverTemplate< ScalarType >::DenseMatrixType = Eigen::MatrixX<ScalarType>

◆ SparseMatrixType

template<typename ScalarType = double>
using Ikarus::LinearSolverTemplate< ScalarType >::SparseMatrixType = Eigen::SparseMatrix<ScalarType>

Constructor & Destructor Documentation

◆ LinearSolverTemplate() [1/3]

template<typename ScalarType = double>
Ikarus::LinearSolverTemplate< ScalarType >::LinearSolverTemplate ( const SolverTypeTag p_solverTypeTag)
explicit
Parameters
p_solverTypeTagThe solver type tag representing the type of the linear solver.

◆ ~LinearSolverTemplate()

template<typename ScalarType = double>
Ikarus::LinearSolverTemplate< ScalarType >::~LinearSolverTemplate ( )
default

◆ LinearSolverTemplate() [2/3]

template<typename ScalarType = double>
Ikarus::LinearSolverTemplate< ScalarType >::LinearSolverTemplate ( const LinearSolverTemplate< ScalarType > &  other)
inline
Parameters
otherThe LinearSolverTemplate to copy.
Here is the caller graph for this function:

◆ LinearSolverTemplate() [3/3]

template<typename ScalarType = double>
Ikarus::LinearSolverTemplate< ScalarType >::LinearSolverTemplate ( LinearSolverTemplate< ScalarType > &&  other)
defaultnoexcept
Parameters
otherThe LinearSolverTemplate to move.

Member Function Documentation

◆ analyzePattern()

template<typename ScalarType = double>
template<typename MatrixType >
requires std::is_same_v<MatrixType, DenseMatrixType> || std::is_same_v<MatrixType, SparseMatrixType>
void Ikarus::LinearSolverTemplate< ScalarType >::analyzePattern ( const MatrixType &  A)
inline
Template Parameters
MatrixTypeThe type of the matrix (DenseMatrixType or SparseMatrixType).
Parameters
AThe matrix for pattern analysis.
Here is the caller graph for this function:

◆ compute()

template<typename ScalarType = double>
template<typename MatrixType >
requires std::is_same_v<MatrixType, DenseMatrixType> || std::is_same_v<MatrixType, SparseMatrixType>
LinearSolverTemplate & Ikarus::LinearSolverTemplate< ScalarType >::compute ( const MatrixType &  A)
inline
Template Parameters
MatrixTypeThe type of the matrix (DenseMatrixType or SparseMatrixType).
Parameters
AThe matrix for factorization.
Returns
A reference to the LinearSolverTemplate.
Here is the caller graph for this function:

◆ factorize()

template<typename ScalarType = double>
template<typename MatrixType >
requires std::is_same_v<MatrixType, DenseMatrixType> || std::is_same_v<MatrixType, SparseMatrixType>
void Ikarus::LinearSolverTemplate< ScalarType >::factorize ( const MatrixType &  A)
inline
Template Parameters
MatrixTypeThe type of the matrix (DenseMatrixType or SparseMatrixType).
Parameters
AThe matrix for factorization.
Here is the caller graph for this function:

◆ operator=() [1/2]

template<typename ScalarType = double>
LinearSolverTemplate & Ikarus::LinearSolverTemplate< ScalarType >::operator= ( const LinearSolverTemplate< ScalarType > &  other)
inline
Parameters
otherThe LinearSolverTemplate to copy.
Returns
A reference to the assigned LinearSolverTemplate.

◆ operator=() [2/2]

template<typename ScalarType = double>
LinearSolverTemplate & Ikarus::LinearSolverTemplate< ScalarType >::operator= ( LinearSolverTemplate< ScalarType > &&  other)
defaultnoexcept
Parameters
otherThe LinearSolverTemplate to move.
Returns
A reference to the assigned LinearSolverTemplate.

◆ solve() [1/4]

template<typename ScalarType = double>
void Ikarus::LinearSolverTemplate< ScalarType >::solve ( Eigen::MatrixX2< ScalarType > &  x,
const Eigen::MatrixX2< ScalarType > &  b 
)
inline
Parameters
xThe solution matrix.
bThe right-hand side matrix.

◆ solve() [2/4]

template<typename ScalarType = double>
void Ikarus::LinearSolverTemplate< ScalarType >::solve ( Eigen::MatrixX3< ScalarType > &  x,
const Eigen::MatrixX3< ScalarType > &  b 
)
inline
Parameters
xThe solution matrix.
bThe right-hand side matrix.

◆ solve() [3/4]

template<typename ScalarType = double>
void Ikarus::LinearSolverTemplate< ScalarType >::solve ( Eigen::MatrixX< ScalarType > &  x,
const Eigen::MatrixX< ScalarType > &  b 
)
inline
Parameters
xThe solution matrix.
bThe right-hand side matrix.

◆ solve() [4/4]

template<typename ScalarType = double>
void Ikarus::LinearSolverTemplate< ScalarType >::solve ( Eigen::VectorX< ScalarType > &  x,
const Eigen::VectorX< ScalarType > &  b 
)
inline
Parameters
xThe solution vector.
bThe right-hand side vector.
Here is the caller graph for this function:

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