|
template<typename T > |
T ** | new_matrix (unsigned int m, unsigned int n=0) |
|
template<typename T > |
T ** | new_matrix_malloc (unsigned int m, unsigned int n=0) |
|
template<typename T > |
void | copy_matrix (T **dest, T **src, unsigned int m, unsigned int n=0) |
|
template<typename T > |
void | save_matrix_octave (const std::string &matrix_name, T **matrix, unsigned int m, unsigned int n=0, const std::string &filename=std::string()) |
| Saves a dense matrix to a octave file format. More...
|
|
template<typename T > |
void | save_sparse_matrix_octave (const std::string &matrix_name, const T *Ax, const int *Ap, const int *Ai, unsigned int m, const std::string &filename=std::string()) |
| Saves MxM sparse matrix to a octave file format.
|
|
template<typename T > |
void | transpose (T **matrix, unsigned int m, unsigned int n) |
|
template<typename T > |
void | chsgn (T **matrix, unsigned int m, unsigned int n) |
| Changes the sign of a matrix.
|
|
HERMES_API void | ludcmp (double **a, int n, int *indx, double *d) |
|
template<typename T > |
void | lubksb (double **a, int n, int *indx, T *b) |
|
HERMES_API void | choldc (double **a, int n, double p[]) |
|
template<typename T > |
void | cholsl (double **a, int n, double p[], T b[], T x[]) |
|
Contains operation on dense matrices.
void Hermes::Algebra::DenseMatrixOperations::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].
Definition at line 99 of file matrix.cpp.
template<typename T >
void Hermes::Algebra::DenseMatrixOperations::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.
Definition at line 241 of file matrix.h.
template<typename T >
void Hermes::Algebra::DenseMatrixOperations::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.
Definition at line 206 of file matrix.h.
void Hermes::Algebra::DenseMatrixOperations::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.
Definition at line 37 of file matrix.cpp.