ATSuite C++
v1.0
Scientific C++ routines originally developed by Alexis Tantet
|
Matrix manipulation. More...
#include <vector>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_vector_int.h>
#include <gsl/gsl_matrix.h>
#include <Eigen/Dense>
#include <Eigen/Sparse>
Go to the source code of this file.
Typedefs | |
typedef Eigen::SparseMatrix< double, Eigen::RowMajor > | SpMatCSR |
Eigen CSR matrix of double type. | |
typedef Eigen::SparseMatrix< int, Eigen::RowMajor > | SpMatIntCSR |
Eigen CSR matrix of integer type. | |
typedef Eigen::SparseMatrix< double, Eigen::ColMajor > | SpMatCSC |
Eigen CSC matrix of double type. | |
typedef Eigen::SparseMatrix< bool, Eigen::ColMajor > | SpMatCSCBool |
Eigen CSC matrix of boolean type. | |
Functions | |
gsl_vector * | getRowSum (SpMatCSR *T) |
Get the sum of each row of an Eigen CSR matrix. More... | |
void | getRowSum (SpMatCSR *T, gsl_vector *rowSum) |
Get the sum of each row of an Eigen CSR matrix. More... | |
gsl_vector_int * | getRowSum (SpMatIntCSR *T) |
Get the sum of each row of an Eigen CSR matrix of integer type. More... | |
gsl_vector * | getColSum (SpMatCSR *T) |
Get the sum of each column of an Eigen CSR matrix. More... | |
void | getColSum (SpMatCSR *T, gsl_vector *colSum) |
Get the sum of each column of an Eigen CSR matrix. More... | |
gsl_vector * | getColSum (SpMatCSC *T) |
Get the sum of each column of an Eigen CSC matrix. More... | |
double | getSum (SpMatCSR *T) |
Returns a the sum of the elements of an Eigen CSR matrix. More... | |
double | sumVectorElements (gsl_vector *v) |
Returns a the sum of the elements of an GSL vector. More... | |
void | normalizeVector (gsl_vector *v) |
Normalize a GSL vector by the sum of its elements. More... | |
void | normalizeRows (SpMatCSR *T, gsl_vector *rowSum) |
Normalize each row of an Eigen CSR matrix by a GSL vector. More... | |
SpMatCSCBool * | cwiseGT (SpMatCSC *T, double ref) |
Perform an element-wise greater than test on an Eigen CSC matrix. More... | |
SpMatCSCBool * | cwiseLT (SpMatCSC *T, double ref) |
Perform an element-wise lower than test on an Eigen CSC matrix. More... | |
bool | any (SpMatCSCBool *T) |
Perform an any operation on an Eigen CSC matrix of boolean type. More... | |
double | max (SpMatCSC *T) |
Finds the maximum element of an Eigen CSC matrix. More... | |
double | min (SpMatCSC *T) |
Finds the minimum element of an Eigen CSC matrix. More... | |
std::vector< int > * | argmax (SpMatCSC *T) |
Finds the position of the maximum element of an Eigen CSC matrix. More... | |
std::vector< int > * | argmin (SpMatCSC *T) |
Finds the position of the minimum element of an Eigen CSC matrix. More... | |
ATSuite matrix manipulation routines.
Definition in file atmatrix.hpp.
bool any | ( | SpMatCSCBool * | T | ) |
Perform an any operation on an Eigen CSC matrix of boolean type.
[in] | T | Eigen CSC matrix of boolean type on which to any. |
Definition at line 300 of file atmatrix.hpp.
std::vector< int > * argmax | ( | SpMatCSC * | T | ) |
Finds the position of the maximum element of an Eigen CSC matrix.
[in] | T | Eigen CSC matrix from which to find the maximum. |
Definition at line 363 of file atmatrix.hpp.
std::vector< int > * argmin | ( | SpMatCSC * | T | ) |
Finds the position of the minimum element of an Eigen CSC matrix.
[in] | T | Eigen CSC matrix from which to find the minimum. |
Definition at line 390 of file atmatrix.hpp.
SpMatCSCBool * cwiseGT | ( | SpMatCSC * | T, |
double | ref | ||
) |
Perform an element-wise greater than test on an Eigen CSC matrix.
[in] | T | Eigen CSC matrix to test. |
[in] | ref | Scalar against which to compare. |
Definition at line 261 of file atmatrix.hpp.
SpMatCSCBool * cwiseLT | ( | SpMatCSC * | T, |
double | ref | ||
) |
Perform an element-wise lower than test on an Eigen CSC matrix.
[in] | T | Eigen CSC matrix to test. |
[in] | ref | Scalar against which to compare. |
Definition at line 281 of file atmatrix.hpp.
gsl_vector * getColSum | ( | SpMatCSR * | T | ) |
Get the sum of each column of an Eigen CSR matrix as a GSL vector.
[in] | T | Eigen CSR matrix on which to sum. |
Definition at line 119 of file atmatrix.hpp.
Referenced by Grid::~Grid().
void getColSum | ( | SpMatCSR * | T, |
gsl_vector * | colSum | ||
) |
Get the sum of each column of an Eigen CSR matrix as a GSL vector (alternate version with output in argument).
[in] | T | Eigen CSR matrix on which to sum. |
[out] | colSum | GSL vector of the sum of columns of the sparse matrix. |
Definition at line 142 of file atmatrix.hpp.
gsl_vector * getColSum | ( | SpMatCSC * | T | ) |
Get the sum of each column of an Eigen CSC matrix as a GSL vector.
[in] | T | Eigen CSC matrix on which to sum. |
Definition at line 164 of file atmatrix.hpp.
gsl_vector * getRowSum | ( | SpMatCSR * | T | ) |
Get the sum of each row of an Eigen CSR matrix as a GSL vector.
[in] | T | Eigen CSR matrix on which to sum. |
Definition at line 56 of file atmatrix.hpp.
Referenced by toRightStochastic(), and Grid::~Grid().
void getRowSum | ( | SpMatCSR * | T, |
gsl_vector * | rowSum | ||
) |
Get the sum of each row of an Eigen CSR matrix as a GSL vector (alternate version with output as argument).
[in] | T | Eigen CSR matrix on which to sum. |
[out] | rowSum | GSL vector of the sum of rows of the sparse matrix. |
Definition at line 78 of file atmatrix.hpp.
gsl_vector_int * getRowSum | ( | SpMatIntCSR * | T | ) |
Get the sum of each row of an Eigen CSR matrix of integer type as a GSL vector.
[in] | T | Eigen CSR matrix of integer type on which to sum. |
Definition at line 99 of file atmatrix.hpp.
double getSum | ( | SpMatCSR * | T | ) |
Returns a the sum over all the elements of an Eigen CSR matrix.
[in] | T | Eigen CSR matrix on which to sum. |
Definition at line 184 of file atmatrix.hpp.
Referenced by toAndStochastic().
double max | ( | SpMatCSC * | T | ) |
Finds the maximum element of an Eigen CSC matrix.
[in] | T | Eigen CSC matrix from which to find the maximum. |
Definition at line 319 of file atmatrix.hpp.
double min | ( | SpMatCSC * | T | ) |
Finds the minimum element of an Eigen CSC matrix.
[in] | T | Eigen CSC matrix from which to find the minimum. |
Definition at line 341 of file atmatrix.hpp.
void normalizeRows | ( | SpMatCSR * | T, |
gsl_vector * | rowSum | ||
) |
Normalize each row of an Eigen CSR matrix by each element of a GSL vector.
[in] | T | Eigen CSR matrix to normalize. |
[in] | rowSum | GSL vector used to normalize the rows of the sparse matrix. |
Definition at line 240 of file atmatrix.hpp.
Referenced by toRightStochastic().
void normalizeVector | ( | gsl_vector * | v | ) |
Normalize a GSL vector by the sum of its elements.
[in] | v | GSL vector to normalize. |
Definition at line 222 of file atmatrix.hpp.
References sumVectorElements().
Referenced by filterTransitionMatrix(), and Grid::~Grid().
double sumVectorElements | ( | gsl_vector * | v | ) |
Returns a the sum over all the elements of an GSL vector.
[in] | v | GSL vector over which to sum. |
Definition at line 205 of file atmatrix.hpp.
Referenced by normalizeVector().