KASKADE 7 development version
Loading...
Searching...
No Matches
Kaskade::CholmodFactorization< Scalar, Index > Class Template Referenceabstract

Factorization of sparse linear systems with CHOLMOD. More...

#include <cholmod_solve.hh>

Inheritance diagram for Kaskade::CholmodFactorization< Scalar, Index >:
Kaskade::Factorization< Scalar >

Public Types

typedef Scalar field_type
 The type of matrix elements (a field type).
using Options = FactorizationOptions

Public Member Functions

 CholmodFactorization (Index n_, std::vector< Index > const &ridx, std::vector< Index > const &cidx, std::vector< Scalar > const &values, FactorizationOptions opt)
 Constructor keeping input data in triplet format (aka coordinate format) constant.
 ~CholmodFactorization ()
void solve (std::vector< Scalar > const &b, std::vector< Scalar > &x, bool=false) const
 Solves the system \( Ax = b \) for the given right hand side.
void solve (Scalar const *b, Scalar *x, bool=false) const
 Solves the system \( Ax = b \) for the given right hand side.
void solve (std::vector< Scalar > const &b, std::vector< Scalar > &x, int nr, bool=false) const
 Solves the system \( Ax = b \) for nr right hand sides.
void solve (std::vector< Scalar > &b) const
 Solves the system \( Ax = b \) for the given right hand side.
void solve (Scalar *b) const
 Solves the system for the given right hand side.
virtual size_t size () const
 reports the dimension of the system
void setVerbose (int verbose_)
int getVerbose () const
Info const & info () const
System solution
virtual void solve (field_type *b) const =0
 Solves the system \( Ax=b \) for the given right hand side \( b \).

Protected Attributes

Options options
Info info_

Detailed Description

template<class Scalar, class Index = int>
class Kaskade::CholmodFactorization< Scalar, Index >

Factorization of sparse linear systems with CHOLMOD.

Template Parameters
Scalarthe scalar matrix entry type (float or double)
Indexthe integer type to be used by CHOLMOD. Either long or int.

Definition at line 47 of file cholmod_solve.hh.

Member Typedef Documentation

◆ field_type

template<class Scalar>
typedef Scalar Kaskade::Factorization< Scalar >::field_type
inherited

The type of matrix elements (a field type).

Definition at line 48 of file factorization.hh.

◆ Options

template<class Scalar>
using Kaskade::Factorization< Scalar >::Options = FactorizationOptions
inherited

Definition at line 50 of file factorization.hh.

Constructor & Destructor Documentation

◆ CholmodFactorization()

template<class Scalar, class Index = int>
Kaskade::CholmodFactorization< Scalar, Index >::CholmodFactorization ( Index n_,
std::vector< Index > const & ridx,
std::vector< Index > const & cidx,
std::vector< Scalar > const & values,
FactorizationOptions opt )

Constructor keeping input data in triplet format (aka coordinate format) constant.

The matrix must be symmetric. Only the lower triangular part is accessed. Construction is factorization!

Parameters
nsize of the (square) matrix, i.e. the number of rows
ridxrow indices
cidxcolumn indices
valuesentry values

◆ ~CholmodFactorization()

template<class Scalar, class Index = int>
Kaskade::CholmodFactorization< Scalar, Index >::~CholmodFactorization ( )

Member Function Documentation

◆ getVerbose()

◆ info()

template<class Scalar>
Info const & Kaskade::Factorization< Scalar >::info ( ) const
inlineinherited

Definition at line 118 of file factorization.hh.

◆ setVerbose()

template<class Scalar>
void Kaskade::Factorization< Scalar >::setVerbose ( int verbose_)
inlineinherited

◆ size()

template<class Scalar, class Index = int>
virtual size_t Kaskade::CholmodFactorization< Scalar, Index >::size ( ) const
inlinevirtual

reports the dimension of the system

Implements Kaskade::Factorization< Scalar >.

Definition at line 148 of file cholmod_solve.hh.

◆ solve() [1/6]

template<class Scalar, class Index = int>
void Kaskade::CholmodFactorization< Scalar, Index >::solve ( Scalar * b) const
inline

Solves the system for the given right hand side.

  • b, which is overwritten with the solution.
Parameters
[in,out]bon entry, right hand side (vector with length at least n). On exit, the first n entries are overwritten with the solution vector.

This is slightly less efficient than providing the solution vector separately, as internally additional work space is allocated and released.

Definition at line 138 of file cholmod_solve.hh.

◆ solve() [2/6]

template<class Scalar, class Index = int>
void Kaskade::CholmodFactorization< Scalar, Index >::solve ( Scalar const * b,
Scalar * x,
bool = false ) const
inlinevirtual

Solves the system \( Ax = b \) for the given right hand side.

  • b.
Parameters
[in]bright hand side vector, an array of length at least n.
[out]xsolution vector, an array of length at least n.

Implements Kaskade::Factorization< Scalar >.

Definition at line 90 of file cholmod_solve.hh.

◆ solve() [3/6]

template<class Scalar, class Index = int>
void Kaskade::CholmodFactorization< Scalar, Index >::solve ( std::vector< Scalar > & b) const
inlinevirtual

Solves the system \( Ax = b \) for the given right hand side.

  • b, which is overwritten with the solution.
Parameters
[in,out]bon entry, right hand side (vector with length at least n). On exit, solution vector of size n.

This is slightly less efficient than providing the solution vector separately, as internally additional work space is allocated and released.

Reimplemented from Kaskade::Factorization< Scalar >.

Definition at line 120 of file cholmod_solve.hh.

◆ solve() [4/6]

template<class Scalar, class Index = int>
void Kaskade::CholmodFactorization< Scalar, Index >::solve ( std::vector< Scalar > const & b,
std::vector< Scalar > & x,
bool = false ) const
inlinevirtual

Solves the system \( Ax = b \) for the given right hand side.

  • b.
Parameters
[out]xsolution vector (resized to the number of matrix columns).

Reimplemented from Kaskade::Factorization< Scalar >.

Definition at line 77 of file cholmod_solve.hh.

Referenced by solve(), and solve().

◆ solve() [5/6]

template<class Scalar, class Index = int>
void Kaskade::CholmodFactorization< Scalar, Index >::solve ( std::vector< Scalar > const & b,
std::vector< Scalar > & x,
int nr,
bool = false ) const
inline

Solves the system \( Ax = b \) for nr right hand sides.

  • b.
Parameters
[in]bright hand side vectors, an array of length at least nr*n.
[out]xsolution vector (will be resized to nr*n).

Definition at line 101 of file cholmod_solve.hh.

◆ solve() [6/6]

template<class Scalar>
virtual void Kaskade::Factorization< Scalar >::solve ( field_type * b) const
pure virtualinherited

Solves the system \( Ax=b \) for the given right hand side \( b \).

Parameters
[in,out]bright hand side, is overwritten with the solution \( x \). This must point to a memory region of length of system dimension.

Member Data Documentation

◆ info_

template<class Scalar>
Info Kaskade::Factorization< Scalar >::info_
protectedinherited

Definition at line 127 of file factorization.hh.

Referenced by Kaskade::MUMPSFactorization< Scalar >::factorize(), and info().

◆ options


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