Wrapper class for double precision GSL matrix routines. More...
#include <src/gsl_wrappers/gsl_matrix_double.h>
Public Types | |
typedef double | value_type |
typedef vector | vector_type |
Public Member Functions | |
matrix () | |
Class constructor without specified matrix dimensions. | |
matrix (size_t new_rows, size_t new_cols, bool clear=true) | |
Class constructor with specified rows and columns. | |
~matrix () | |
Class destructor. | |
void | set_element (size_t row, size_t col, const double &v) |
Function that inputs a value for a particular matrix entry. | |
double | get_element (size_t row, size_t col) const |
Function that retrieves a value from a particular matrix entry. | |
void | dimensions (size_t *num_rows, size_t *num_cols) const |
Function that gets the dimensions of a matrix. | |
void | set_dimensions (size_t new_rows, size_t new_cols) |
Function that sets the size of a matrix. | |
const double & | operator() (size_t row, size_t col) const |
Function returning pointer to (i,j) element of a matrix. | |
double & | operator() (size_t row, size_t col) |
Another function returning pointer to (i,j) element of a matrix. | |
template<class oclass > | |
void | copy (const oclass &other) |
Copy function that copies another type of matrix. | |
matrix (const matrix &other) | |
Copy constructor for the matrix. | |
template<class oclass > | |
matrix (const oclass &other) | |
Copy constructor for the different matrix classes. | |
matrix | submatrix (size_t row_min, size_t row_max, size_t col_min, size_t col_max) const |
Function that extracts a submatrix from the given matrix. | |
void | set_zero () |
Function that sets all entries of a matrix to zero. | |
size_t | get_rows () const |
Function that gets the number of rows of the matrix. | |
size_t | get_cols () const |
Function that gets the number of columns of the matrix. | |
size_t | size1 () const |
Another function that gets the number of columns of the matrix. | |
size_t | size2 () const |
Another function that gets the number of columns of the matrix. | |
int | fwrite (FILE *stream) const |
Function that writes the contents of the matrix in binary format. | |
int | fread (FILE *stream) |
Function that reads the contents from open stream in binary format. | |
int | fprintf (FILE *stream, const char *format) const |
Function that prints the contents of the matrix. | |
int | fscanf (FILE *stream) |
Function that reads contents and assigns then to a matrix. | |
vector_view | row (size_t rowindex) |
Function that returns a vector_view of a single row of the matrix. | |
const vector_view | row (size_t rowindex) const |
Function that returns a vector_view of a single row of the matrix. | |
vector_view | column (size_t colindex) |
Function that returns a vector_view of a single column of the matrix. | |
const vector_view | column (size_t colindex) const |
Function that returns a vector_view of a single row of the matrix. | |
vector_view | diagonal () |
Function that returns the diagonal of the matrix. | |
const vector_view | diagonal () const |
Function that returns the diagonal of the matrix. | |
matrix & | operator= (const matrix &other) |
Function that equates two matrices. | |
template<class omatrix > | |
matrix & | operator= (const omatrix &other) |
Function that equates two matrices of different classes. | |
bool | operator== (const matrix &other) const |
Function that checks if two matrices are equivalent. | |
bool | operator!= (const matrix &other) const |
Function that checks if two matrices are not equivalent. | |
matrix | operator+ (const matrix &other) const |
Function that adds two matrices. | |
matrix | operator+ (const double &f) const |
Function that adds a constant scalar to a matrix. | |
matrix & | operator+= (const double &f) |
Function that adds a constant scalar to matrix. | |
matrix & | operator+= (const matrix &other) |
Function that adds anoher matrix of any class. | |
matrix | operator- (const matrix &other) const |
Function that subtracts two matrices. | |
matrix | operator- (const double &f) const |
Function that subtracts a scalar from a matrix. | |
matrix & | operator-= (const double &f) |
Function that subtracts a constant scalar from a matrix. | |
matrix & | operator-= (const matrix &other) |
Function that subtracts two matrices. | |
matrix | operator* (const matrix &other) const |
Function that multiplies two matrices. | |
matrix | operator* (const double &f) const |
Function that multiplies a matrix and a scalar. | |
matrix & | operator*= (const double &f) |
Function that multiplies the scalar and a matrix. | |
matrix & | operator*= (const matrix &other) |
Function that overloads the *= operator for matrices. | |
matrix | operator/ (const double &) const |
Function that divides a matrix by a scalar. | |
matrix & | operator/= (const double &) |
Function that overloads the /= operator between scalars and matrices. | |
void | diag (const vector &v) |
Function that sets the diagonal of a vector. | |
void | set_tridiag (const vector &v1, const vector &v2, const vector &v3) |
Function that sets three vectors as diagonals of a tri-diagonal matrix. | |
matrix | transpose () const |
Function that transposes a matrix. | |
matrix | LU_decomp (permutation *perm=NULL, int *psign=NULL) const |
Function that computes the LU decomposition of a matrix. | |
matrix | LU_invert () const |
Function that inverts a matrix. | |
double | sum () const |
Function that sums over all entries of a matrix. | |
double | row_sum (size_t rowindex) const |
Function that returns the sum of a particular row. | |
double | col_sum (size_t colindex) const |
Function that returns the sum of a particular column. | |
double | LU_lndet () const |
Function that computes the logarithm of the determinant of a matrix. | |
int | cholesky_decomp (matrix &a) const |
Function that computes the Cholesky decompsition of a matrix. | |
gsl_matrix * | gslobj () |
Matrix object for interfacing with BLAS and/or GSL C libraies. | |
const gsl_matrix * | gslobj () const |
Const matrix object for interfacing with BLAS and/or GSL C libraries. | |
Private Attributes | |
gsl_matrix * | m |
GSL matrix of double object. | |
Friends | |
class | matrix_int |
matrix | operator+ (const double &f, const matrix &other) |
Function that adds a constant scalar to another class of matrix. | |
matrix | operator- (const double &f, const matrix &other) |
Function that subtracts a constant scalar from another class of matrix. | |
matrix | operator* (const double &f, const matrix &other) |
Function that multiplies a matrix of another class and a scalar. |
Wrapper class for double precision GSL matrix routines.