phelm::Matrix Class Reference
[Linear equations solver.]

Matrix class. More...

#include <solver.h>

List of all members.

Public Member Functions

 Matrix (int n)
 create matrix NxN.
void add (int i, int j, double a)
 Add a number to element (i, j) (A[i][j] += a).
void solve (double *x, const double *b)
 Solve equation Ax = b.
void mult_vector (double *out, const double *in)
 Product of matrix by vector (out = A in).
void print ()
 print matrix to stdout.


Detailed Description

Matrix class.
Examples:

test_system_laplace.cpp.

Definition at line 70 of file solver.h.


Constructor & Destructor Documentation

Matrix::Matrix ( int  n  ) 

create matrix NxN.

Parameters:
n - dimension

Definition at line 62 of file solver.cpp.


Member Function Documentation

void Matrix::add ( int  i,
int  j,
double  a 
)

Add a number to element (i, j) (A[i][j] += a).

Parameters:
i - index
j - index
a - value

Definition at line 73 of file solver.cpp.

void Matrix::mult_vector ( double *  out,
const double *  in 
)

Product of matrix by vector (out = A in).

Parameters:
out - result
in - input vector

Definition at line 81 of file solver.cpp.

void Matrix::solve ( double *  x,
const double *  b 
)

Solve equation Ax = b.

That function uses GMRES or UMFPACK or Gauss depends on compilation flags. If SPARSE and GMRES are defined then use GMRES If SPARSE is defined then use UMFPACK If SPARSE is not defined then use Gauss

Parameters:
x - answer
b - right part

Definition at line 98 of file solver.cpp.


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

Phelm Library
Copyright © 2009 Alexey Ozeritsky. All rights reserved.
http://resetius.ru