23 template <
typename MATRIX,
typename Float>
class precondition;
32 template <
typename MATRIX,
typename Float>
class solver {
131 throw std::runtime_error(
"error bad filename");
247 auto create = [](MATRIX &) {};
std::function< void(const vector< Float > &r, vector< Float > &z)> apply_precond
std::function< void(void)> get_precond()
std::function< void(MATRIX &)> create_precond
vector< Float > get_precond_data()
void set_precond_data(vector< Float > &m)
std::ostream * rhistory_stream
size_t get_maxiter() const
get maxiter
int get_lib() const
get library option
void set_miniter(size_t min)
set min iter. (default = 0)
std::string rhistory_file
void set_tol(double t)
set tolerance (default:1.0e-8)
int get_reorder()
0: no ordering 1: symrcm, 2: symamd, 3: csrmetisnd is used to reduce zero fill-in.
void set_apply_precond(PRECOND &p)
set precondition apply function
double get_final_residual()
void set_residual_method(size_t r)
set residual method (default=0)
void set_print_rhistory(bool flag)
print rhistory to standart out true/false. (default = false)
void set_lib(int l)
set library option (to change library, monolish, cusolver, etc.)
bool get_print_rhistory() const
get print rhistory status
Float get_residual(vector< Float > &x)
precondition< MATRIX, Float > precond
void set_maxiter(size_t max)
set max iter. (default = SIZE_MAX)
void set_reorder(int r)
0: no ordering 1: symrcm, 2: symamd, 3: csrmetisnd is used to reduce zero fill-in.
Float get_omega()
get the relaxation coefficient omega for SOR method (Default: 1.9)
void set_omega(Float w)
set the relaxation coefficient omega for SOR method (0 < w < 2, Default: 1.9)
size_t get_residual_method() const
get residual method(default=0)
void set_initvec_scheme(initvec_scheme scheme)
set how to handle initial vector
~solver()
delete solver class
initvec_scheme get_initvec_scheme() const
get handling scheme of initial vector handling
initvec_scheme initvecscheme
double get_tol() const
get tolerance
size_t get_miniter() const
get miniter
void set_rhistory_filename(std::string file)
rhistory filename
solver()
create solver class
void set_create_precond(PRECOND &p)
set precondition create function
int get_singularity()
-1 if A is symmetric positive definite. default reorder algorithm is csrmetisnd
void max(const matrix::CRS< double > &A, const matrix::CRS< double > &B, matrix::CRS< double > &C)
Create a new CRS matrix with greatest elements of two matrices (C[0:nnz] = max(A[0:nnz],...
void min(const matrix::CRS< double > &A, const matrix::CRS< double > &B, matrix::CRS< double > &C)
Create a new CRS matrix with smallest elements of two matrices (C[0:nnz] = min(A[0:nnz],...
initvec_scheme
Enum class defining how to handle initial vectors RANDOM use randomly initialized vectors USER use in...