Public Member Functions | Protected Attributes | List of all members
vnl_linear_system Class Referenceabstract

Abstraction for a linear system of equations. More...

#include <vnl_linear_system.h>

Inheritance diagram for vnl_linear_system:
Inheritance graph
[legend]

Public Member Functions

 vnl_linear_system (unsigned int number_of_unknowns, unsigned int number_of_residuals)
 
virtual ~vnl_linear_system ()
 
virtual void multiply (vnl_vector< double > const &x, vnl_vector< double > &y) const =0
 Compute A*x, putting result in y. More...
 
virtual void transpose_multiply (vnl_vector< double > const &y, vnl_vector< double > &x) const =0
 Compute A_transpose * y, putting result in x. More...
 
virtual void get_rhs (vnl_vector< double > &b) const =0
 
virtual void apply_preconditioner (vnl_vector< double > const &x, vnl_vector< double > &px) const
 
unsigned int get_number_of_unknowns () const
 Return the number of unknowns. More...
 
unsigned int get_number_of_residuals () const
 Return the number of residuals. More...
 
double get_rms_error (vnl_vector< double > const &x) const
 Compute rms error for parameter vector x. More...
 
double get_relative_residual (vnl_vector< double > const &x) const
 Compute relative residual (|Ax - b| / |b| )for parameter vector x. More...
 

Protected Attributes

unsigned int p_
 
unsigned int n_
 

Detailed Description

Abstraction for a linear system of equations.

vnl_linear_system provides an abstraction for a linear system of equations, Ax = b, to be solved by one of the iterative linear solvers. Access to the systems is via the pure virtual methods multiply() and transpose_multiply(). This procedural access scheme makes it possible to solve very large, sparse systems which it would be inefficient to store in matrix form.

To solve the system, use an algorithm like vnl_lsqr.

Definition at line 27 of file vnl_linear_system.h.

Constructor & Destructor Documentation

◆ vnl_linear_system()

vnl_linear_system::vnl_linear_system ( unsigned int  number_of_unknowns,
unsigned int  number_of_residuals 
)
inline

Definition at line 31 of file vnl_linear_system.h.

◆ ~vnl_linear_system()

vnl_linear_system::~vnl_linear_system ( )
virtualdefault

Member Function Documentation

◆ apply_preconditioner()

void vnl_linear_system::apply_preconditioner ( vnl_vector< double > const &  x,
vnl_vector< double > &  px 
) const
virtual

Reimplemented in vnl_sparse_matrix_linear_system< T >.

Definition at line 12 of file vnl_linear_system.cxx.

◆ get_number_of_residuals()

unsigned int vnl_linear_system::get_number_of_residuals ( ) const
inline

Return the number of residuals.

Definition at line 56 of file vnl_linear_system.h.

◆ get_number_of_unknowns()

unsigned int vnl_linear_system::get_number_of_unknowns ( ) const
inline

Return the number of unknowns.

Definition at line 53 of file vnl_linear_system.h.

◆ get_relative_residual()

double vnl_linear_system::get_relative_residual ( vnl_vector< double > const &  x) const

Compute relative residual (|Ax - b| / |b| )for parameter vector x.

Definition at line 32 of file vnl_linear_system.cxx.

◆ get_rhs()

virtual void vnl_linear_system::get_rhs ( vnl_vector< double > &  b) const
pure virtual

◆ get_rms_error()

double vnl_linear_system::get_rms_error ( vnl_vector< double > const &  x) const

Compute rms error for parameter vector x.

Definition at line 19 of file vnl_linear_system.cxx.

◆ multiply()

virtual void vnl_linear_system::multiply ( vnl_vector< double > const &  x,
vnl_vector< double > &  y 
) const
pure virtual

◆ transpose_multiply()

virtual void vnl_linear_system::transpose_multiply ( vnl_vector< double > const &  y,
vnl_vector< double > &  x 
) const
pure virtual

Member Data Documentation

◆ n_

unsigned int vnl_linear_system::n_
protected

Definition at line 66 of file vnl_linear_system.h.

◆ p_

unsigned int vnl_linear_system::p_
protected

Definition at line 65 of file vnl_linear_system.h.


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