Public Member Functions | Protected Attributes
vnl_linear_system Class Reference

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

#include <vnl_linear_system.h>

Inheritance diagram for vnl_linear_system:
Inheritance graph
[legend]

List of all members.

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.
virtual void transpose_multiply (vnl_vector< double > const &y, vnl_vector< double > &x) const =0
 Compute A_transpose * y, putting result in x.
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.
unsigned int get_number_of_residuals () const
 Return the number of residuals.
double get_rms_error (vnl_vector< double > const &x) const
 Compute rms error for parameter vector x.
double get_relative_residual (vnl_vector< double > const &x) const
 Compute relative residual (|Ax - b| / |b| )for parameter vector x.

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 29 of file vnl_linear_system.h.


Constructor & Destructor Documentation

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

Definition at line 33 of file vnl_linear_system.h.

vnl_linear_system::~vnl_linear_system ( ) [virtual]

Definition at line 13 of file vnl_linear_system.cxx.


Member Function Documentation

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 17 of file vnl_linear_system.cxx.

unsigned int vnl_linear_system::get_number_of_residuals ( ) const [inline]

Return the number of residuals.

Definition at line 58 of file vnl_linear_system.h.

unsigned int vnl_linear_system::get_number_of_unknowns ( ) const [inline]

Return the number of unknowns.

Definition at line 55 of file vnl_linear_system.h.

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 37 of file vnl_linear_system.cxx.

virtual void vnl_linear_system::get_rhs ( vnl_vector< double > &  b) const [pure virtual]
double vnl_linear_system::get_rms_error ( vnl_vector< double > const &  x) const

Compute rms error for parameter vector x.

Definition at line 24 of file vnl_linear_system.cxx.

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

Compute A*x, putting result in y.

Implemented in vnl_sparse_matrix_linear_system< T >.

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

Compute A_transpose * y, putting result in x.

Implemented in vnl_sparse_matrix_linear_system< T >.


Member Data Documentation

unsigned int vnl_linear_system::n_ [protected]

Definition at line 68 of file vnl_linear_system.h.

unsigned int vnl_linear_system::p_ [protected]

Definition at line 67 of file vnl_linear_system.h.


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