Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

RazorBack::Lu_ Class Reference

Lu_: a class for doing LU-decomposition. More...

#include <Lu.hh>

List of all members.

Public Methods

 Lu_ (unsigned int N=3)
 Inits to an N x N problem (default 3).

 Lu_ (const Rmatdbl_ &A)
 Inits with the decomposition of the square matrix A.

int decomp (const Rmatdbl_ &A)
 decomp(A): performs an LU-decomposition on the square matrix A. More...

double det () const
 det(): calculates the determinant from the decomposition results stored inside. More...

Vecdbl_ solve (const Vecdbl_ &B) const
 solve(B): solves the linear equation A*x=B and returns x. More...

int lineq (const Rmatdbl_ &A, const Vecdbl_ &B, Vecdbl_ &X, unsigned int Maxit=0)
 lineq(A, B, X, Maxit): solves the nxn linear equation A*X=B and returns X. More...


Private Attributes

Rmatdbl_ Lu
 holds the decomposition.

vector<unsigned int> Perm
 permutation vector.

int Psign
 permutation sign.


Static Private Attributes

const double LU_EPSILON
 a very small number.


Detailed Description

Lu_: a class for doing LU-decomposition.

Can be asked to calculate determinants and solve linear equation systems.

Definition at line 33 of file Lu.hh.


Constructor & Destructor Documentation

RazorBack::Lu_::Lu_ ( unsigned int N = 3 ) [inline, explicit]
 

Inits to an N x N problem (default 3).

Definition at line 48 of file Lu.hh.

RazorBack::Lu_::Lu_ ( const Rmatdbl_ & A ) [inline, explicit]
 

Inits with the decomposition of the square matrix A.

Definition at line 51 of file Lu.hh.


Member Function Documentation

int RazorBack::Lu_::decomp ( const Rmatdbl_ & A )
 

decomp(A): performs an LU-decomposition on the square matrix A.

Return value: the permutation sign (0 if A was singular). Throws Squarexc_ if A was not NxN.

Referenced by Lu_().

double RazorBack::Lu_::det ( ) const
 

det(): calculates the determinant from the decomposition results stored inside.

It is assumed that decomp() has been called beforehand.

Vecdbl_ RazorBack::Lu_::solve ( const Vecdbl_ & B ) const
 

solve(B): solves the linear equation A*x=B and returns x.

The calling object is supposed to have been primed with decomp(A) before this call. B is the "right-hand-side" vector which is preserved. Throws a Dimexc_ exception if B's dimension does not match A's.

int RazorBack::Lu_::lineq ( const Rmatdbl_ & A,
const Vecdbl_ & B,
Vecdbl_ & X,
unsigned int Maxit = 0 )
 

lineq(A, B, X, Maxit): solves the nxn linear equation A*X=B and returns X.

Iterative improvement is done a la Num. Recipes (max. Maxit times, default 0). This routine should be used if only one right-hand side vector B is present. For several right-hand sides, use the decomposition and solver routines separately. Return value: 1 means OK, 0 means A was singular. Throws Squarexc_ if A was not NxN, Dimexc_ on dim mismatches.


Member Data Documentation

const double RazorBack::Lu_::LU_EPSILON [static, private]
 

a very small number.

Definition at line 38 of file Lu.hh.

Rmatdbl_ RazorBack::Lu_::Lu [private]
 

holds the decomposition.

Definition at line 40 of file Lu.hh.

vector< unsigned int > RazorBack::Lu_::Perm<unsigned int> [private]
 

permutation vector.

Definition at line 41 of file Lu.hh.

int RazorBack::Lu_::Psign [private]
 

permutation sign.

Definition at line 42 of file Lu.hh.


The documentation for this class was generated from the following file:
Generated at Wed Aug 21 09:33:25 2002 for The Razorback C++ Library: Linear Algebra by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001