cgv
Loading...
Searching...
No Matches
cgv::math::sparse_les Class Referenceabstract

interface for implementations of solvers for sparse linear systems of the form A * x = b with a square matrix A. More...

#include <sparse_les.h>

Inheritance diagram for cgv::math::sparse_les:
cgv::data::ref_counted

Public Member Functions

virtual ~sparse_les ()
 virtual destructor since class is abstract
 
problem setup
virtual void set_mat_entry (int r, int c, double val)=0
 set entry in row r and column c in the sparse matrix A
 
virtual void set_b_entry (int i, double val)
 set i-th entry in a single right hand side b
 
virtual void set_b_entry (int i, int j, double val)=0
 set i-th entry in the j-th right hand side
 
virtual double & ref_b_entry (int i)
 return reference to i-th entry in a single right hand side b
 
virtual double & ref_b_entry (int i, int j)=0
 set i-th entry in j-th right hand side
 
virtual bool solve (bool analyze_residual=false)=0
 try to solve system - in case of success analyze residuals if demanded by the optional parameter
 
access to solution
virtual double get_x_entry (int i) const
 return the i-th component of a single solution vector
 
virtual double get_x_entry (int i, int j) const =0
 return the i-th component of the j-th solution vector
 
- Public Member Functions inherited from cgv::data::ref_counted
int get_ref_count () const
 read access to current count
 

Static Public Member Functions

static interface
static void register_solver_factory (sparse_les_factory_ptr sls_fac)
 register a factory for a new type of linear equation solver
 
static const std::vector< sparse_les_factory_ptr > & get_solver_factories ()
 return the list of registered solvers
 
static sparse_les_ptr create_by_name (const std::string &solver_name, int n, int nr_rhs, int nr_nze=-1)
 check the registered solver types for one with the given name
 
static sparse_les_ptr create_by_cap (SparseLesCaps caps, int n, int nr_rhs, int nr_nze=-1)
 check the registered solver types for one with the given capabilities and create an instance of it
 

Additional Inherited Members

- Protected Member Functions inherited from cgv::data::ref_counted
 ref_counted ()
 constructor initializes the count to 0
 
void set_ref_count (int c) const
 write access is also const to allow ref counted pointers to const instances
 

Detailed Description

interface for implementations of solvers for sparse linear systems of the form A * x = b with a square matrix A.

Definition at line 51 of file sparse_les.h.

Constructor & Destructor Documentation

◆ ~sparse_les()

virtual cgv::math::sparse_les::~sparse_les ( )
inlinevirtual

virtual destructor since class is abstract

Definition at line 55 of file sparse_les.h.

Member Function Documentation

◆ create_by_cap()

sparse_les_ptr cgv::math::sparse_les::create_by_cap ( SparseLesCaps  caps,
int  n,
int  nr_rhs,
int  nr_nze = -1 
)
static

check the registered solver types for one with the given capabilities and create an instance of it

Definition at line 41 of file sparse_les.cxx.

◆ create_by_name()

sparse_les_ptr cgv::math::sparse_les::create_by_name ( const std::string &  solver_name,
int  n,
int  nr_rhs,
int  nr_nze = -1 
)
static

check the registered solver types for one with the given name

Definition at line 30 of file sparse_les.cxx.

◆ get_solver_factories()

const std::vector< sparse_les_factory_ptr > & cgv::math::sparse_les::get_solver_factories ( )
static

return the list of registered solvers

Definition at line 24 of file sparse_les.cxx.

◆ get_x_entry()

double cgv::math::sparse_les::get_x_entry ( int  i) const
virtual

return the i-th component of a single solution vector

Definition at line 62 of file sparse_les.cxx.

References get_x_entry().

Referenced by get_x_entry().

◆ ref_b_entry()

double & cgv::math::sparse_les::ref_b_entry ( int  i)
virtual

return reference to i-th entry in a single right hand side b

Definition at line 57 of file sparse_les.cxx.

References ref_b_entry().

Referenced by ref_b_entry().

◆ register_solver_factory()

void cgv::math::sparse_les::register_solver_factory ( sparse_les_factory_ptr  sls_fac)
static

register a factory for a new type of linear equation solver

Definition at line 19 of file sparse_les.cxx.

◆ set_b_entry()

void cgv::math::sparse_les::set_b_entry ( int  i,
double  val 
)
virtual

set i-th entry in a single right hand side b

Definition at line 52 of file sparse_les.cxx.

References set_b_entry().

Referenced by set_b_entry().


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