5 #include <cgv/data/ref_ptr.h>
12 class CGV_API sparse_les;
57 static const std::vector<sparse_les_factory_ptr>& get_solver_factories();
59 static sparse_les_ptr create_by_name(
const std::string& solver_name,
int n,
int nr_rhs,
int nr_nze = -1);
65 virtual void set_mat_entry(
int r,
int c,
double val) = 0;
68 virtual void set_b_entry(
int i,
double val);
72 virtual double& ref_b_entry(
int i);
76 virtual bool solve(
bool analyze_residual =
false) = 0;
80 virtual double get_x_entry(
int i)
const;
92 std::string solver_name;
96 solver_name(_solver_name), caps(_caps) {}
121 #include <cgv/config/lib_end.h>
virtual void set_b_entry(int i, int j, double val)=0
set i-th entry in the j-th right hand side
std::string get_solver_name() const
return the name of the solver
Definition: sparse_les.h:100
implementation of factory class for sparse linear system solvers
Definition: sparse_les.h:90
cgv::data::ref_ptr< sparse_les, true > sparse_les_ptr
reference counted pointer type for sparse les solver
Definition: sparse_les.h:15
static void register_solver_factory(sparse_les_factory_ptr sls_fac)
register a factory for a new type of linear equation solver
Definition: sparse_les.cxx:14
bool solve(const up_tri_mat< T > &a, const vec< T > &b, vec< T > &x)
Definition: lin_solve.h:20
factory class for sparse linear system solvers
Definition: sparse_les.h:28
cgv::data::ref_ptr< sparse_les_factory, true > sparse_les_factory_ptr
reference counted pointer type for sparse les solver factories
Definition: sparse_les.h:45
sparse_les_ptr create(int n, int nr_rhs, int nr_nze)
create an instance of the solver.
Definition: sparse_les.h:102
SparseLesCaps
capability options for a sparse linear solver
Definition: sparse_les.h:19
helper template to register a sparse les solver
Definition: sparse_les.h:111
SparseLesCaps get_caps() const
return the supported capabilities of the solver
Definition: sparse_les.h:98
virtual double get_x_entry(int i, int j) const =0
return the i-th component of the j-th solution vector
Definition: ref_counted.h:11
virtual std::string get_solver_name() const =0
return the name of the solver
virtual SparseLesCaps get_caps() const =0
return the supported capabilities of the solver
Definition: sparse_les.h:50
virtual sparse_les_ptr create(int n, int nr_rhs, int nr_nze=-1)=0
create an instance of the solver.
the cgv namespace
Definition: vr_calib.cxx:9
virtual double & ref_b_entry(int i, int j)=0
set i-th entry in j-th right hand side