#include <solver.h>
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. | |
Definition at line 70 of file solver.h.
| Matrix::Matrix | ( | int | n | ) |
| void Matrix::add | ( | int | i, | |
| int | j, | |||
| double | a | |||
| ) |
Add a number to element (i, j) (A[i][j] += a).
| 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).
| 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
| x | - answer | |
| b | - right part |
Definition at line 98 of file solver.cpp.