version 0.4.1
Ikarus::LinearSolverTemplate< ST > 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< ST >:
[legend]

Public Types

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

Public Member Functions

 LinearSolverTemplate (const SolverTypeTag &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 ST = double>
class Ikarus::LinearSolverTemplate< ST >
Template Parameters
STThe scalar type of the linear system (default: double).

Member Typedef Documentation

◆ DenseMatrixType

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

◆ ScalarType

template<typename ST = double>
using Ikarus::LinearSolverTemplate< ST >::ScalarType = ST

◆ SparseMatrixType

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

Constructor & Destructor Documentation

◆ LinearSolverTemplate() [1/3]

template<typename ST = double>
Ikarus::LinearSolverTemplate< ST >::LinearSolverTemplate ( const SolverTypeTag solverTypeTag)
explicit
Parameters
solverTypeTagThe solver type tag representing the type of the linear solver.

◆ ~LinearSolverTemplate()

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

◆ LinearSolverTemplate() [2/3]

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

◆ LinearSolverTemplate() [3/3]

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

Member Function Documentation

◆ analyzePattern()

template<typename ST = double>
template<typename MatrixType >
requires std::is_same_v<MatrixType, DenseMatrixType> || std::is_same_v<MatrixType, SparseMatrixType>
void Ikarus::LinearSolverTemplate< ST >::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 ST = double>
template<typename MatrixType >
requires std::is_same_v<MatrixType, DenseMatrixType> || std::is_same_v<MatrixType, SparseMatrixType>
LinearSolverTemplate & Ikarus::LinearSolverTemplate< ST >::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 ST = double>
template<typename MatrixType >
requires std::is_same_v<MatrixType, DenseMatrixType> || std::is_same_v<MatrixType, SparseMatrixType>
void Ikarus::LinearSolverTemplate< ST >::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 ST = double>
LinearSolverTemplate & Ikarus::LinearSolverTemplate< ST >::operator= ( const LinearSolverTemplate< ST > &  other)
inline
Parameters
otherThe LinearSolverTemplate to copy.
Returns
A reference to the assigned LinearSolverTemplate.

◆ operator=() [2/2]

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

◆ solve() [1/4]

template<typename ST = double>
void Ikarus::LinearSolverTemplate< ST >::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 ST = double>
void Ikarus::LinearSolverTemplate< ST >::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 ST = double>
void Ikarus::LinearSolverTemplate< ST >::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 ST = double>
void Ikarus::LinearSolverTemplate< ST >::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: