Classes |
| class | Matrix |
| class | SparseMatrix |
| struct | SparseMatrix::Page |
| class | Vector |
Enumerations |
| enum | EMatrixDumpFormat { DF_MATLAB_SPARSE,
DF_PLAIN_ASCII,
DF_HERMES_BIN,
DF_NATIVE
} |
Functions |
| template<typename T > |
| T ** | new_matrix (int m, int n=0) |
| | Creates a new (full) matrix with m rows and n columns with entries of the type T. The entries can be accessed by matrix[i][j]. To delete the matrix, just do "delete matrix".
|
| template<typename T > |
| void | transpose (T **matrix, int m, int n) |
| | Transposes an m by n matrix. If m != n, the array matrix in fact has to be a square matrix of the size max(m, n) in order for the transpose to fit inside it.
|
| template<typename T > |
| void | chsgn (T **matrix, int m, int n) |
| | Changes the sign of a matrix.
|
| void | ludcmp (double **a, int n, int *indx, double *d) |
| | Given a matrix a[n][n], this routine replaces it by the LU decomposition of a rowwise permutation of itself. a and n are input. a is output, arranged as in equation (2.3.14) above; indx[n] is an output vector that records the row permutation effected by the partial pivoting; d is output as +-1 depending on whether the number of row interchanges was even or odd, respectively. This routine is used in combination with lubksb to solve linear equations or invert a matrix.
|
| template<typename T > |
| void | lubksb (double **a, int n, int *indx, T *b) |
| | Solves the set of n linear equations AX = B. Here a[n][n] is input, not as the matrix A but rather as its LU decomposition, determined by the routine ludcmp. indx[n] is input as the permutation vector returned by ludcmp. b[n] is input as the right-hand side vector B, and returns with the solution vector X. a, n, and indx are not modified by this routine and can be left in place for successive calls with different right-hand sides b. This routine takes into account the possibility that b will begin with many zero elements, so it is efficient for use in matrix inversion.
|
| void | choldc (double **a, int n, double p[]) |
| | Given a positive-definite symmetric matrix a[n][n], this routine constructs its Cholesky decomposition, A = L*L^T . On input, only the upper triangle of a need be given; it is not modified. The Cholesky factor L is returned in the lower triangle of a, except for its diagonal elements which are returned in p[n].
|
| template<typename T > |
| void | cholsl (double **a, int n, double p[], T b[], T x[]) |
| | Solves the set of n linear equations A*x = b, where a is a positive-definite symmetric matrix. a[n][n] and p[n] are input as the output of the routine choldc. Only the lower subdiagonal portion of a is accessed. b[n] is input as the right-hand side vector. The solution vector is returned in x[n]. a, n, and p are not modified and can be left in place for successive calls with different right-hand sides b. b is not modified unless you identify b and x in the calling sequence, which is allowed. The right-hand side b can be complex, in which case the solution x is also complex.
|
template<typename T >
| void cholsl |
( |
double ** |
a, |
|
|
int |
n, |
|
|
double |
p[], |
|
|
T |
b[], |
|
|
T |
x[] | |
|
) |
| | [inline] |
Solves the set of n linear equations A*x = b, where a is a positive-definite symmetric matrix. a[n][n] and p[n] are input as the output of the routine choldc. Only the lower subdiagonal portion of a is accessed. b[n] is input as the right-hand side vector. The solution vector is returned in x[n]. a, n, and p are not modified and can be left in place for successive calls with different right-hand sides b. b is not modified unless you identify b and x in the calling sequence, which is allowed. The right-hand side b can be complex, in which case the solution x is also complex.
template<typename T >
| void lubksb |
( |
double ** |
a, |
|
|
int |
n, |
|
|
int * |
indx, |
|
|
T * |
b | |
|
) |
| | [inline] |
Solves the set of n linear equations AX = B. Here a[n][n] is input, not as the matrix A but rather as its LU decomposition, determined by the routine ludcmp. indx[n] is input as the permutation vector returned by ludcmp. b[n] is input as the right-hand side vector B, and returns with the solution vector X. a, n, and indx are not modified by this routine and can be left in place for successive calls with different right-hand sides b. This routine takes into account the possibility that b will begin with many zero elements, so it is efficient for use in matrix inversion.