libgenua
Basic Geometry, Numerical Algorithms and Interfaces
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AbstractLinearSolverTpl< FloatType > Class Template Referenceabstract

Detailed Description

template<class FloatType>
class AbstractLinearSolverTpl< FloatType >

Templated interface for linear solver.

This template class defines the common interface for all of the wrappers around linear solvers. This is useful to allow switching between different solvers at runtime.

Note that not all backend solvers actually support all matrix types and all precisions.

See Also
SpoolesSolver, PardisoSolver, SparseQR, EigenSparseLU, EigenSparseChol

#include <abstractlinearsolver.h>

Inheritance diagram for AbstractLinearSolverTpl< FloatType >:
[legend]

Public Member Functions

 AbstractLinearSolverTpl ()
 default construction for undefined matrix type
 
 AbstractLinearSolverTpl (uint typeflag)
 construction for defined matrix type
 
virtual ~AbstractLinearSolverTpl ()
 virtual destructor
 
uint matrixType () const
 the matrix type for which this solver has been instantiated
 
const std::string & name () const
 solver name (libary/implementation)
 
virtual void configure (const ConfigParser &)
 load configuration settings
 
virtual bool factor (const CsrMatrix< FloatType, 1 > *pa)=0
 full factorization (minimum interface)
 
virtual bool refactor (const CsrMatrix< FloatType, 1 > *pa)
 numerical factorization only (if supported)
 
void transposed (bool flag)
 request to solve the transposed problem (not always supported)
 
virtual bool solve (const DMatrix< FloatType > &b, DMatrix< FloatType > &x)=0
 solve with multiple rhs
 
virtual bool solve (const DVector< FloatType > &b, DVector< FloatType > &x)
 solve single RHS (by default implemented in terms of the above)
 
virtual bool solve (const CsrMatrix< FloatType, 1 > *pa, const DMatrix< FloatType > &b, DMatrix< FloatType > &x)
 single-shot solve (may be more efficient for some solvers)
 
virtual bool solve (const CsrMatrix< FloatType, 1 > *pa, const DVector< FloatType > &b, DVector< FloatType > &x)
 single-shot solve (may be more efficient for some solvers)
 
virtual bool resolve (const CsrMatrix< FloatType, 1 > *pa, const DMatrix< FloatType > &b, DMatrix< FloatType > &x)
 solution with new values in A, but the same non-zero pattern
 
virtual bool resolve (const CsrMatrix< FloatType, 1 > *pa, const DVector< FloatType > &b, DVector< FloatType > &x)
 solution with new values in A, but the same non-zero pattern
 
size_t factorizations () const
 number of (re-) factorizations
 
size_t solves () const
 number of (re-) factorizations
 
virtual float factorTime () const
 access timing data (if supported by implementation)
 
virtual float solveTime () const
 access timing data (if supported by implementation)
 
virtual float maxMemory () const
 memory, in Megabyte, as reported by solver (if possible)
 
virtual void release ()
 release internal storage
 
virtual double condest ()
 return estimated condition number after factorization (if supported)
 
void verbose (bool flag)
 enable diagnostid printing
 

Static Public Member Functions

static SolverPtr create (uint)
 Create a new instance of any solver which is supported by the library. More...
 

Protected Member Functions

bool isSymmetric ()
 matrix property tests
 
bool isReal ()
 matrix property tests
 
bool isComplex ()
 matrix property tests
 

Protected Attributes

uint m_mtxflags
 matrix type flag
 
std::string m_implName
 implementation/solver/library name for logging
 
float m_factorTime
 timing data; only useful if child classes set these values
 
size_t m_factorCount
 call statistics; only useful if child classes set these values
 
bool m_solveTransposed = false
 whether to solve the transposed problem A^T x = b
 
int m_verbose = 0
 print diagnostic info?
 

Member Function Documentation

template<class FloatType>
static SolverPtr AbstractLinearSolverTpl< FloatType >::create ( uint  )
inlinestatic

Create a new instance of any solver which is supported by the library.

Use this interface only when there really is no preferred choice of the solver implementation. The current interface will return an MKL PARDISO interface, a SPOOLES interface, or a SparseQR interface when one of those is supported by the compiled library.


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