monolish  0.17.3-dev.16
MONOlithic LInear equation Solvers for Highly-parallel architecture
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
monolish::solver::solver< MATRIX, Float > Class Template Reference

solver base class More...

#include <monolish_solver.hpp>

Inheritance diagram for monolish::solver::solver< MATRIX, Float >:
Inheritance graph
Collaboration diagram for monolish::solver::solver< MATRIX, Float >:
Collaboration graph

Public Member Functions

size_t get_final_iter ()
 
double get_final_residual ()
 
initvec_scheme get_initvec_scheme () const
 get handling scheme of initial vector handling More...
 
int get_lib () const
 get library option More...
 
size_t get_maxiter () const
 get maxiter More...
 
size_t get_miniter () const
 get miniter More...
 
Float get_omega ()
 get the relaxation coefficient omega for SOR method (Default: 1.9) More...
 
bool get_print_rhistory () const
 get print rhistory status More...
 
int get_reorder ()
 0: no ordering 1: symrcm, 2: symamd, 3: csrmetisnd is used to reduce zero fill-in. More...
 
size_t get_residual_method () const
 get residual method(default=0) More...
 
int get_singularity ()
 -1 if A is symmetric positive definite. default reorder algorithm is csrmetisnd More...
 
double get_tol () const
 get tolerance More...
 
template<class PRECOND >
void set_apply_precond (PRECOND &p)
 set precondition apply function More...
 
template<class PRECOND >
void set_create_precond (PRECOND &p)
 set precondition create function More...
 
void set_initvec_scheme (initvec_scheme scheme)
 set how to handle initial vector More...
 
void set_lib (int l)
 set library option (to change library, monolish, cusolver, etc.) More...
 
void set_maxiter (size_t max)
 set max iter. (default = SIZE_MAX) More...
 
void set_miniter (size_t min)
 set min iter. (default = 0) More...
 
void set_omega (Float w)
 set the relaxation coefficient omega for SOR method (0 < w < 2, Default: 1.9) More...
 
void set_print_rhistory (bool flag)
 print rhistory to standart out true/false. (default = false) More...
 
void set_reorder (int r)
 0: no ordering 1: symrcm, 2: symamd, 3: csrmetisnd is used to reduce zero fill-in. More...
 
void set_residual_method (size_t r)
 set residual method (default=0) More...
 
void set_rhistory_filename (std::string file)
 rhistory filename More...
 
void set_tol (double t)
 set tolerance (default:1.0e-8) More...
 
 solver ()
 create solver class More...
 
 ~solver ()
 delete solver class More...
 

Protected Member Functions

Float get_residual (vector< Float > &x)
 

Protected Attributes

size_t final_iter = 0
 
double final_resid = 0
 
initvec_scheme initvecscheme = initvec_scheme::RANDOM
 
int lib = 0
 
size_t maxiter = SIZE_MAX
 
size_t miniter = 0
 
Float omega = 1.9
 
precondition< MATRIX, Float > precond
 
bool print_rhistory = false
 
int reorder = 3
 
size_t resid_method = 0
 
std::string rhistory_file
 
std::ostream * rhistory_stream
 
int singularity
 
double tol = 1.0e-8
 

Detailed Description

template<typename MATRIX, typename Float>
class monolish::solver::solver< MATRIX, Float >

solver base class

Definition at line 32 of file monolish_solver.hpp.

Constructor & Destructor Documentation

◆ solver()

template<typename MATRIX , typename Float >
monolish::solver::solver< MATRIX, Float >::solver ( )
inline

create solver class

Definition at line 59 of file monolish_solver.hpp.

◆ ~solver()

template<typename MATRIX , typename Float >
monolish::solver::solver< MATRIX, Float >::~solver ( )
inline

delete solver class

Definition at line 64 of file monolish_solver.hpp.

Member Function Documentation

◆ get_final_iter()

template<typename MATRIX , typename Float >
size_t monolish::solver::solver< MATRIX, Float >::get_final_iter ( )
inline

Definition at line 226 of file monolish_solver.hpp.

◆ get_final_residual()

template<typename MATRIX , typename Float >
double monolish::solver::solver< MATRIX, Float >::get_final_residual ( )
inline

Definition at line 225 of file monolish_solver.hpp.

◆ get_initvec_scheme()

template<typename MATRIX , typename Float >
initvec_scheme monolish::solver::solver< MATRIX, Float >::get_initvec_scheme ( ) const
inline

get handling scheme of initial vector handling

Returns
current handling scheme of initial vector

Definition at line 182 of file monolish_solver.hpp.

◆ get_lib()

template<typename MATRIX , typename Float >
int monolish::solver::solver< MATRIX, Float >::get_lib ( ) const
inline

get library option

Returns
library number

Definition at line 146 of file monolish_solver.hpp.

◆ get_maxiter()

template<typename MATRIX , typename Float >
size_t monolish::solver::solver< MATRIX, Float >::get_maxiter ( ) const
inline

get maxiter

Returns
maxiter

Definition at line 158 of file monolish_solver.hpp.

◆ get_miniter()

template<typename MATRIX , typename Float >
size_t monolish::solver::solver< MATRIX, Float >::get_miniter ( ) const
inline

get miniter

Returns
miniter

Definition at line 164 of file monolish_solver.hpp.

◆ get_omega()

template<typename MATRIX , typename Float >
Float monolish::solver::solver< MATRIX, Float >::get_omega ( )
inline

get the relaxation coefficient omega for SOR method (Default: 1.9)

Returns
The relaxation coefficient of SOR
Note
This variable is only used in SOR method

Definition at line 199 of file monolish_solver.hpp.

◆ get_print_rhistory()

template<typename MATRIX , typename Float >
bool monolish::solver::solver< MATRIX, Float >::get_print_rhistory ( ) const
inline

get print rhistory status

Returns
print rhistory true/false

Definition at line 176 of file monolish_solver.hpp.

◆ get_reorder()

template<typename MATRIX , typename Float >
int monolish::solver::solver< MATRIX, Float >::get_reorder ( )
inline

0: no ordering 1: symrcm, 2: symamd, 3: csrmetisnd is used to reduce zero fill-in.

Note
This variable is only used in sparse QR/Cholesky for GPU

Definition at line 215 of file monolish_solver.hpp.

◆ get_residual()

template<typename MATRIX , typename Float >
Float monolish::solver::solver< MATRIX, Float >::get_residual ( vector< Float > &  x)
protected

◆ get_residual_method()

template<typename MATRIX , typename Float >
size_t monolish::solver::solver< MATRIX, Float >::get_residual_method ( ) const
inline

get residual method(default=0)

Returns
residual method number

Definition at line 170 of file monolish_solver.hpp.

◆ get_singularity()

template<typename MATRIX , typename Float >
int monolish::solver::solver< MATRIX, Float >::get_singularity ( )
inline

-1 if A is symmetric positive definite. default reorder algorithm is csrmetisnd

Note
This variable is only used in sparse QR/Cholesky for GPU

Definition at line 223 of file monolish_solver.hpp.

◆ get_tol()

template<typename MATRIX , typename Float >
double monolish::solver::solver< MATRIX, Float >::get_tol ( ) const
inline

get tolerance

Returns
tolerance

Definition at line 152 of file monolish_solver.hpp.

◆ set_apply_precond()

template<typename MATRIX , typename Float >
template<class PRECOND >
void monolish::solver::solver< MATRIX, Float >::set_apply_precond ( PRECOND &  p)

set precondition apply function

Parameters
[in]psolver class for precondition

◆ set_create_precond()

template<typename MATRIX , typename Float >
template<class PRECOND >
void monolish::solver::solver< MATRIX, Float >::set_create_precond ( PRECOND &  p)

set precondition create function

Parameters
[in]psolver class for precondition

◆ set_initvec_scheme()

template<typename MATRIX , typename Float >
void monolish::solver::solver< MATRIX, Float >::set_initvec_scheme ( initvec_scheme  scheme)
inline

set how to handle initial vector

Parameters
[in]schemeRANDOM or USER

Definition at line 139 of file monolish_solver.hpp.

◆ set_lib()

template<typename MATRIX , typename Float >
void monolish::solver::solver< MATRIX, Float >::set_lib ( int  l)
inline

set library option (to change library, monolish, cusolver, etc.)

Parameters
[in]llibrary number

Definition at line 86 of file monolish_solver.hpp.

◆ set_maxiter()

template<typename MATRIX , typename Float >
void monolish::solver::solver< MATRIX, Float >::set_maxiter ( size_t  max)
inline

set max iter. (default = SIZE_MAX)

Parameters
[in]maxmaxiter

Definition at line 98 of file monolish_solver.hpp.

Here is the call graph for this function:

◆ set_miniter()

template<typename MATRIX , typename Float >
void monolish::solver::solver< MATRIX, Float >::set_miniter ( size_t  min)
inline

set min iter. (default = 0)

Parameters
[in]minminiter

Definition at line 104 of file monolish_solver.hpp.

Here is the call graph for this function:

◆ set_omega()

template<typename MATRIX , typename Float >
void monolish::solver::solver< MATRIX, Float >::set_omega ( Float  w)
inline

set the relaxation coefficient omega for SOR method (0 < w < 2, Default: 1.9)

Parameters
[in]winput omega value
Note
This variable is only used in SOR method

Definition at line 191 of file monolish_solver.hpp.

◆ set_print_rhistory()

template<typename MATRIX , typename Float >
void monolish::solver::solver< MATRIX, Float >::set_print_rhistory ( bool  flag)
inline

print rhistory to standart out true/false. (default = false)

Parameters
[in]flag

Definition at line 116 of file monolish_solver.hpp.

◆ set_reorder()

template<typename MATRIX , typename Float >
void monolish::solver::solver< MATRIX, Float >::set_reorder ( int  r)
inline

0: no ordering 1: symrcm, 2: symamd, 3: csrmetisnd is used to reduce zero fill-in.

Note
This variable is only used in sparse QR/Cholesky for GPU

Definition at line 207 of file monolish_solver.hpp.

◆ set_residual_method()

template<typename MATRIX , typename Float >
void monolish::solver::solver< MATRIX, Float >::set_residual_method ( size_t  r)
inline

set residual method (default=0)

Parameters
[in]rresidual method number (0:nrm2)

Definition at line 110 of file monolish_solver.hpp.

◆ set_rhistory_filename()

template<typename MATRIX , typename Float >
void monolish::solver::solver< MATRIX, Float >::set_rhistory_filename ( std::string  file)
inline

rhistory filename

Parameters
[in]fileoutput file name

Definition at line 125 of file monolish_solver.hpp.

◆ set_tol()

template<typename MATRIX , typename Float >
void monolish::solver::solver< MATRIX, Float >::set_tol ( double  t)
inline

set tolerance (default:1.0e-8)

Parameters
[in]ttolerance

Definition at line 92 of file monolish_solver.hpp.

Member Data Documentation

◆ final_iter

template<typename MATRIX , typename Float >
size_t monolish::solver::solver< MATRIX, Float >::final_iter = 0
protected

Definition at line 46 of file monolish_solver.hpp.

◆ final_resid

template<typename MATRIX , typename Float >
double monolish::solver::solver< MATRIX, Float >::final_resid = 0
protected

Definition at line 45 of file monolish_solver.hpp.

◆ initvecscheme

template<typename MATRIX , typename Float >
initvec_scheme monolish::solver::solver< MATRIX, Float >::initvecscheme = initvec_scheme::RANDOM
protected

Definition at line 43 of file monolish_solver.hpp.

◆ lib

template<typename MATRIX , typename Float >
int monolish::solver::solver< MATRIX, Float >::lib = 0
protected

Definition at line 35 of file monolish_solver.hpp.

◆ maxiter

template<typename MATRIX , typename Float >
size_t monolish::solver::solver< MATRIX, Float >::maxiter = SIZE_MAX
protected

Definition at line 38 of file monolish_solver.hpp.

◆ miniter

template<typename MATRIX , typename Float >
size_t monolish::solver::solver< MATRIX, Float >::miniter = 0
protected

Definition at line 37 of file monolish_solver.hpp.

◆ omega

template<typename MATRIX , typename Float >
Float monolish::solver::solver< MATRIX, Float >::omega = 1.9
protected

Definition at line 48 of file monolish_solver.hpp.

◆ precond

template<typename MATRIX , typename Float >
precondition<MATRIX, Float> monolish::solver::solver< MATRIX, Float >::precond
protected

Definition at line 53 of file monolish_solver.hpp.

◆ print_rhistory

template<typename MATRIX , typename Float >
bool monolish::solver::solver< MATRIX, Float >::print_rhistory = false
protected

Definition at line 40 of file monolish_solver.hpp.

◆ reorder

template<typename MATRIX , typename Float >
int monolish::solver::solver< MATRIX, Float >::reorder = 3
protected

Definition at line 50 of file monolish_solver.hpp.

◆ resid_method

template<typename MATRIX , typename Float >
size_t monolish::solver::solver< MATRIX, Float >::resid_method = 0
protected

Definition at line 39 of file monolish_solver.hpp.

◆ rhistory_file

template<typename MATRIX , typename Float >
std::string monolish::solver::solver< MATRIX, Float >::rhistory_file
protected

Definition at line 41 of file monolish_solver.hpp.

◆ rhistory_stream

template<typename MATRIX , typename Float >
std::ostream* monolish::solver::solver< MATRIX, Float >::rhistory_stream
protected

Definition at line 42 of file monolish_solver.hpp.

◆ singularity

template<typename MATRIX , typename Float >
int monolish::solver::solver< MATRIX, Float >::singularity
protected

Definition at line 49 of file monolish_solver.hpp.

◆ tol

template<typename MATRIX , typename Float >
double monolish::solver::solver< MATRIX, Float >::tol = 1.0e-8
protected

Definition at line 36 of file monolish_solver.hpp.


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