Public Member Functions | Private Attributes | Friends

matrix_int Class Reference

Wrapper class for GSL integer matrices routines. More...

#include <src/gsl_wrappers/gsl_matrix_integer.h>

List of all members.

Public Member Functions

 matrix_int ()
 Class constructor without specified matrix dimensions.
 matrix_int (size_t new_rows, size_t new_cols, bool clear=true)
 Class constructor with specified rows and columns.
 ~matrix_int ()
 Class destructor.
size_t get_rows () const
 Function that gets the number of rows of a matrix.
size_t get_cols () const
 Function that gets the number of columns of a matrix.
size_t size1 () const
 Another function to gets the number of rpws of a matrix.
size_t size2 () const
 Another function to gets the number of columns of a matrix.
int fwrite (FILE *stream) const
 Function that writes the contents of the matrix to open stream 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.
void dimensions (size_t *num_rows, size_t *num_cols) const
 Function that gets the dimensions of a matrix.
template<class oclass >
void copy (const oclass &other)
 Copy function that copies another type of matrix.
 matrix_int (const matrix_int &other)
 Copy constructor for class matrix_int.
template<class oclass >
 matrix_int (const oclass &other)
 Copy constructor for the different matrix classes.
int get_element (size_t row, size_t col) const
 Function that retrieves a value from a particular matrix entry.
const int & operator() (size_t row, size_t col) const
 Function returning pointer to (i,j) element of a matrix.
int & operator() (size_t row, size_t col)
 Another function returning pointer to (i,j) element of a matrix.
void set_element (size_t row, size_t col, const int &v)
 Function that inputs a value for a particular matrix entry.
void set_elements (const int &new_value)
 Function that sets a particular value for all matrix elements.
void set_all (const int &new_value)
 Amother Function that sets a particular value for all matrix elements.
void set_zero ()
 Function that sets all entries of matrix to zero.
void set_dimensions (size_t new_rows, size_t new_cols)
 Function that sets the size of a matrix.
bool operator== (const matrix_int &other) const
 Function that checks if two matrices are equivalent.
bool operator!= (const matrix_int &other) const
 Function that checks if two matrices are not equivalent.
matrix_intoperator= (const matrix_int &other)
 Function that assigns one matrix as another.
template<class omatrix >
matrix_intoperator= (const omatrix &other)
 Function that equates two matrices of different classes.
matrix_int operator+ (const matrix_int &other) const
 Function that adds two matrices.
matrix_int operator+ (const int &f) const
 Function that adds a constant integer to a matrix.
matrix_intoperator+= (const int &f)
 Function that adds a constant integer to matrix.
matrix_intoperator+= (const matrix_int &other)
 Function that adds anoher matrix of any class.
matrix_int operator- (const matrix_int &other) const
 Function that subtracts two matrices.
matrix_int operator- (const int &f) const
 Function that subtracts an integer from a matrix.
matrix_intoperator-= (const int &f)
 Function that subtracts a constant sinteger from a matrix.
matrix_intoperator-= (const matrix_int &other)
 Function that subtracts two matrices.
matrix_int operator* (const int &f) const
 Function that multiplies two matrices.
matrix_intoperator*= (const int &f)
 Function that multiplies a matrix and a scalar.
matrix_int operator/ (const int &) const
 Function that divides a matrix by an integer.
matrix_intoperator/= (const int &)
 Function that overloads the /= operator between integers and matrices.
matrix_int transpose () const
 Function that transposes a matrix of integers.
matrix_int 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.
int sum () const
 Function that sums over all entries of a matrix.
int row_sum (size_t rowindex) const
 Function that returns the sum of a particular row.
int col_sum (size_t colindex) const
 Function that returns the sum of a particular column.
matrix_int get_row (size_t rowindex) const
 Function that returns a particular row.
matrix_int get_col (size_t colindex) const
 Function that returns a particular column.
matrix_int row_sum () const
 Function that calculates sum of rows returned as a column matrix.
matrix_int column_sum () const
 Function that calculates sum of columns returned as a row matrix.
double trace () const
 Function that computes the trace of a matrix.
double max () const
 Function that computes maximum entry in a matrix.
double min () const
 Function that computes minimum entry in a matrix.
matrix_int LU_decomp (permutation *perm=NULL, int *psign=NULL) const
 Function that computes the LU decomposition of a matrix.
matrix_int LU_invert () const
 Function that inverts a matrix.
double LU_lndet () const
 Function that computes the logarithm of the determinant of a matrix.
int cholesky_decomp (matrix_int &a) const
 Function that computes the Cholesky decompsition of a matrix.
gsl_matrix_int * gslobj ()
 Matrix object for interfacing with BLAS and/or GSL C libraries.
const gsl_matrix_int * gslobj () const
 Const matrix object for interfacing with BLAS and/or GSL C libraries.

Private Attributes

gsl_matrix_int * m
 GSL matrix of integers object.

Friends

matrix_int operator+ (const int &f, const matrix_int &other)
 Function that adds a constant integer to another class of matrix.
matrix_int operator- (const int &f, const matrix_int &other)
 Function that subtracts a constant integer from another class of matrix.
matrix_int operator* (const int &f, const matrix_int &other)
 Function that multiplies a matrix of another class and an integer.

Detailed Description

Wrapper class for GSL integer matrices routines.

This header file includes the C++ wrapper for gsl matrices of the datatype 'integer', i.e matrices with integer elements. Much of the routines are taken from the GSLwrap project. The oblective is to use special features of C++ such as operator overloading to enable a Matlab-like environment for development. The core GSLwrap libraries are freely available from http://sourceforge.net/projects/gslwrap/files/0.2/shrinkwrap/gslwrap-0.2.tar.gz/download Additional information on GSLwrap is available from http://gslwrap.sourceforge.net/ We include the files with this distribution as some additions have been made to the files from GSLwrap for additional functionality.

Authors:
Ramin Nakisa, Marcel Bosc, Rochan R. Upadhyay etc.

The documentation for this class was generated from the following files:
All Classes Files Functions Variables Typedefs Friends Defines