G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
< gsSolverOp
Ptr
 Shared pointer for gsSolverOp.
 
typedef memory::unique_ptr
< gsSolverOp
uPtr
 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 More...
 
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 Functions

(Note that these are not member functions.)

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
template<typename T , int _Opt, typename _Index >
gsSolverOp< typename
gsSparseSolver< T >
::SimplicialLDLT >::uPtr 
makeSparseCholeskySolver (const gsSparseMatrix< T, _Opt, _Index > &mat)
 Convenience function to create a sparse Cholesky (simplicial LDL^T) solver as a gsLinearOperator. More...
 
template<typename T , int _Opt, typename _Index >
gsSolverOp< typename
gsSparseSolver< 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. More...
 
template<typename T , int _Opt, typename _Index >
gsSolverOp< typename
gsSparseSolver< T >::LU >
::uPtr 
makeSparseLUSolver (const gsSparseMatrix< T, _Opt, _Index > &mat)
 Convenience function to create a sparse LU solver as a gsLinearOperator. More...
 
template<typename T , int _Opt, typename _Index >
gsSolverOp< typename
gsSparseSolver< 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. More...
 
template<typename T , int _Opt, typename _Index >
gsSolverOp< typename
gsSparseSolver< T >::QR >
::uPtr 
makeSparseQRSolver (const gsSparseMatrix< T, _Opt, _Index > &mat)
 Convenience function to create a sparse QR solver as a gsLinearOperator. More...
 
template<typename T , int _Opt, typename _Index >
gsSolverOp< typename
gsSparseSolver< 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. More...
 

Member Function Documentation

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 Function Documentation

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.
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.
gsSolverOp< gsEigen::FullPivLU< gsEigen::Matrix< T, _Rows, _Cols, _Opt > > >::uPtr makeFullPivLUSolver ( const gsMatrix< T, _Rows, _Cols, _Opt > &  mat)
related

Convenience function to create an LU solver with full pivoting (for dense matrices) as a gsLinearOperator.

gsSolverOp< gsEigen::FullPivLU< gsEigen::Matrix< T, _Rows, _Cols, _Opt > > >::uPtr makeFullPivLUSolver ( const memory::shared_ptr< gsMatrix< T, _Rows, _Cols, _Opt > > &  mat)
related

Convenience function to create an LU solver with full pivoting (for dense matrices) as a gsLinearOperator taking a shared pointer.

gsSolverOp< gsEigen::PartialPivLU< gsEigen::Matrix< T, _Rows, _Cols, _Opt > > >::uPtr makePartialPivLUSolver ( const gsMatrix< T, _Rows, _Cols, _Opt > &  mat)
related

Convenience function to create an LU solver with partial pivoting (for dense matrices) as a gsLinearOperator.

gsSolverOp< gsEigen::PartialPivLU< gsEigen::Matrix< T, _Rows, _Cols, _Opt > > >::uPtr makePartialPivLUSolver ( const memory::shared_ptr< gsMatrix< T, _Rows, _Cols, _Opt > > &  mat)
related

Convenience function to create an LU solver with partial pivoting (for dense matrices) as a gsLinearOperator taking a shared pointer.

gsSolverOp< typename gsSparseSolver< 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.
gsSolverOp< typename gsSparseSolver< 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.
gsSolverOp< typename gsSparseSolver< 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.
gsSolverOp< typename gsSparseSolver< 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.
gsSolverOp< typename gsSparseSolver< 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.
gsSolverOp< typename gsSparseSolver< 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.