G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsSolverOp< SolverType > Class Template Reference

Detailed Description

template<class SolverType>
class gismo::gsSolverOp< SolverType >

Simple adapter class to use an Eigen solver (having a compute() and a solve() method) as a linear operator.

+ Inheritance diagram for gsSolverOp< SolverType >:
+ Collaboration diagram for gsSolverOp< SolverType >:

Public Types

typedef memory::shared_ptr< gsSolverOpPtr
 Shared pointer for gsSolverOp.
 
typedef memory::unique_ptr< gsSolverOpuPtr
 Unique pointer for gsSolverOp.
 

Public Member Functions

void apply (const gsMatrix< T > &input, gsMatrix< T > &x) const
 apply the operator on the input vector and store the result in x
 
index_t cols () const
 Returns the number of columns of the operator.
 
 gsSolverOp (const MatrixType &mat)
 Constructor taking a matrix.
 
 gsSolverOp (const memory::shared_ptr< MatrixType > &mat)
 Constructor taking a shared pointer.
 
index_t rows () const
 Returns the number of rows of the operator.
 
virtual void setOptions (const gsOptionList &)
 Set options based on a gsOptionList object.
 
SolverType & solver ()
 Access the solver class.
 
const SolverType & solver () const
 Access the solver class.
 

Static Public Member Functions

static gsOptionList defaultOptions ()
 Get the default options as gsOptionList object.
 
static gsIdentityOp< SolverType::Scalar > Identity (const index_t dim)
 Identity operator.
 
static uPtr make (const MatrixType &mat)
 Make function taking a matrix OR a shared pointer.
 

Related Symbols

(Note that these are not member symbols.)

template<class T , int _Rows, int _Cols, int _Opt>
gsSolverOp< gsEigen::LDLT< gsEigen::Matrix< T, _Rows, _Cols, _Opt > > >::uPtr makeCholeskySolver (const gsMatrix< T, _Rows, _Cols, _Opt > &mat)
 Convenience function to create a Cholesky (LDL^T) solver (for dense matrices) as a gsLinearOperator.
 
template<class T , int _Rows, int _Cols, int _Opt>
gsSolverOp< gsEigen::LDLT< gsEigen::Matrix< T, _Rows, _Cols, _Opt > > >::uPtr makeCholeskySolver (const memory::shared_ptr< gsMatrix< T, _Rows, _Cols, _Opt > > &mat)
 Convenience function to create a Cholesky (LDL^T) solver (for dense matrices) as a gsLinearOperator taking a shared pointer.
 
template<class T , int _Rows, int _Cols, int _Opt>
gsSolverOp< gsEigen::FullPivLU< gsEigen::Matrix< T, _Rows, _Cols, _Opt > > >::uPtr makeFullPivLUSolver (const gsMatrix< T, _Rows, _Cols, _Opt > &mat)
 Convenience function to create an LU solver with full pivoting (for dense matrices) as a gsLinearOperator.
 
template<class T , int _Rows, int _Cols, int _Opt>
gsSolverOp< gsEigen::FullPivLU< gsEigen::Matrix< T, _Rows, _Cols, _Opt > > >::uPtr makeFullPivLUSolver (const memory::shared_ptr< gsMatrix< T, _Rows, _Cols, _Opt > > &mat)
 Convenience function to create an LU solver with full pivoting (for dense matrices) as a gsLinearOperator taking a shared pointer.
 
template<class T , int _Rows, int _Cols, int _Opt>
gsSolverOp< gsEigen::PartialPivLU< gsEigen::Matrix< T, _Rows, _Cols, _Opt > > >::uPtr makePartialPivLUSolver (const gsMatrix< T, _Rows, _Cols, _Opt > &mat)
 Convenience function to create an LU solver with partial pivoting (for dense matrices) as a gsLinearOperator.
 
template<class T , int _Rows, int _Cols, int _Opt>
gsSolverOp< gsEigen::PartialPivLU< gsEigen::Matrix< T, _Rows, _Cols, _Opt > > >::uPtr makePartialPivLUSolver (const memory::shared_ptr< gsMatrix< T, _Rows, _Cols, _Opt > > &mat)
 Convenience function to create an LU solver with partial pivoting (for dense matrices) as a gsLinearOperator taking a shared pointer.
 
template<typename T , int _Opt, typename _Index >
gsSolverOp< typenamegsSparseSolver< T >::SimplicialLDLT >::uPtr makeSparseCholeskySolver (const gsSparseMatrix< T, _Opt, _Index > &mat)
 Convenience function to create a sparse Cholesky (simplicial LDL^T) solver as a gsLinearOperator.
 
template<typename T , int _Opt, typename _Index >
gsSolverOp< typenamegsSparseSolver< T >::SimplicialLDLT >::uPtr makeSparseCholeskySolver (const memory::shared_ptr< gsSparseMatrix< T, _Opt, _Index > > &mat)
 Convenience function to create a sparse Cholesky (simplicial LDL^T) solver as a gsLinearOperator.
 
template<typename T , int _Opt, typename _Index >
gsSolverOp< typenamegsSparseSolver< T >::LU >::uPtr makeSparseLUSolver (const gsSparseMatrix< T, _Opt, _Index > &mat)
 Convenience function to create a sparse LU solver as a gsLinearOperator.
 
template<typename T , int _Opt, typename _Index >
gsSolverOp< typenamegsSparseSolver< T >::LU >::uPtr makeSparseLUSolver (const memory::shared_ptr< gsSparseMatrix< T, _Opt, _Index > > &mat)
 Convenience function to create a sparse LU solver as a gsLinearOperator taking a shared pointer.
 
template<typename T , int _Opt, typename _Index >
gsSolverOp< typenamegsSparseSolver< T >::QR >::uPtr makeSparseQRSolver (const gsSparseMatrix< T, _Opt, _Index > &mat)
 Convenience function to create a sparse QR solver as a gsLinearOperator.
 
template<typename T , int _Opt, typename _Index >
gsSolverOp< typenamegsSparseSolver< T >::QR >::uPtr makeSparseQRSolver (const memory::shared_ptr< gsSparseMatrix< T, _Opt, _Index > > &mat)
 Convenience function to create a sparse QR solver as a gsLinearOperator taking a shared pointer.
 

Member Function Documentation

◆ apply()

template<class SolverType >
void apply ( const gsMatrix< T > &  input,
gsMatrix< T > &  x 
) const
inlinevirtual

apply the operator on the input vector and store the result in x

Parameters
inputInput vector
xresult vector

Implements gsLinearOperator< SolverType::Scalar >.

Friends And Related Symbol Documentation

◆ makeCholeskySolver() [1/2]

template<class T , int _Rows, int _Cols, int _Opt>
gsSolverOp< gsEigen::LDLT< gsEigen::Matrix< T, _Rows, _Cols, _Opt > > >::uPtr makeCholeskySolver ( const gsMatrix< T, _Rows, _Cols, _Opt > &  mat)
related

Convenience function to create a Cholesky (LDL^T) solver (for dense matrices) as a gsLinearOperator.

Note
Works only on symmetric (stored in lower half) and positive (semi-)definite matrices.

◆ makeCholeskySolver() [2/2]

template<class T , int _Rows, int _Cols, int _Opt>
gsSolverOp< gsEigen::LDLT< gsEigen::Matrix< T, _Rows, _Cols, _Opt > > >::uPtr makeCholeskySolver ( const memory::shared_ptr< gsMatrix< T, _Rows, _Cols, _Opt > > &  mat)
related

Convenience function to create a Cholesky (LDL^T) solver (for dense matrices) as a gsLinearOperator taking a shared pointer.

Note
Works only on symmetric (stored in lower half) and positive (semi-)definite matrices.

◆ makeSparseCholeskySolver() [1/2]

template<typename T , int _Opt, typename _Index >
gsSolverOp< typenamegsSparseSolver< T >::SimplicialLDLT >::uPtr makeSparseCholeskySolver ( const gsSparseMatrix< T, _Opt, _Index > &  mat)
related

Convenience function to create a sparse Cholesky (simplicial LDL^T) solver as a gsLinearOperator.

Note
Works only on sparse, symmetric (stored in lower half) and positive definite matrices.

◆ makeSparseCholeskySolver() [2/2]

template<typename T , int _Opt, typename _Index >
gsSolverOp< typenamegsSparseSolver< T >::SimplicialLDLT >::uPtr makeSparseCholeskySolver ( const memory::shared_ptr< gsSparseMatrix< T, _Opt, _Index > > &  mat)
related

Convenience function to create a sparse Cholesky (simplicial LDL^T) solver as a gsLinearOperator.

Note
Works only on sparse, symmetric (stored in lower half) and positive definite matrices taking a shared pointer.

◆ makeSparseLUSolver() [1/2]

template<typename T , int _Opt, typename _Index >
gsSolverOp< typenamegsSparseSolver< T >::LU >::uPtr makeSparseLUSolver ( const gsSparseMatrix< T, _Opt, _Index > &  mat)
related

Convenience function to create a sparse LU solver as a gsLinearOperator.

Note
This uses the default COLAMD column ordering.

◆ makeSparseLUSolver() [2/2]

template<typename T , int _Opt, typename _Index >
gsSolverOp< typenamegsSparseSolver< T >::LU >::uPtr makeSparseLUSolver ( const memory::shared_ptr< gsSparseMatrix< T, _Opt, _Index > > &  mat)
related

Convenience function to create a sparse LU solver as a gsLinearOperator taking a shared pointer.

Note
This uses the default COLAMD column ordering.

◆ makeSparseQRSolver() [1/2]

template<typename T , int _Opt, typename _Index >
gsSolverOp< typenamegsSparseSolver< T >::QR >::uPtr makeSparseQRSolver ( const gsSparseMatrix< T, _Opt, _Index > &  mat)
related

Convenience function to create a sparse QR solver as a gsLinearOperator.

Note
This uses the default COLAMD column ordering.

◆ makeSparseQRSolver() [2/2]

template<typename T , int _Opt, typename _Index >
gsSolverOp< typenamegsSparseSolver< T >::QR >::uPtr makeSparseQRSolver ( const memory::shared_ptr< gsSparseMatrix< T, _Opt, _Index > > &  mat)
related

Convenience function to create a sparse QR solver as a gsLinearOperator taking a shared pointer.

Note
This uses the default COLAMD column ordering.