ATSuite C++
v1.0
Scientific C++ routines originally developed by Alexis Tantet
|
Markov transition matrix manipulation. More...
#include <list>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_vector_int.h>
#include <gsl/gsl_matrix.h>
#include <Eigen/Dense>
#include <Eigen/Sparse>
#include <ATSuite/atmatrix.hpp>
Go to the source code of this file.
Macros | |
#define | plog2p(x) ( (x) > 0.0 ? (x) * log(x) / log(2) : 0.0 ) |
Calculates the log of x by x. | |
Typedefs | |
typedef SparseMatrix< double, RowMajor > | SpMatCSR |
Eigen CSR matrix of double type. | |
typedef SparseMatrix< int, RowMajor > | SpMatIntCSR |
Eigen CSR matrix of integer type. | |
typedef SparseMatrix< double, ColMajor > | SpMatCSC |
Eigen CSC matrix of double type. | |
typedef SparseMatrix< bool, ColMajor > | SpMatCSCBool |
Eigen CSC matrix of boolean type. | |
Functions | |
void | toRightStochastic (SpMatCSC *T) |
Make an Eigen CSC matrix right stochastic. More... | |
void | toRightStochastic (SpMatCSR *T) |
Make an Eigen CSR matrix right stochastic. More... | |
void | toLeftStochastic (SpMatCSR *T) |
Make an Eigen CSR matrix left stochastic. More... | |
void | toAndStochastic (SpMatCSR *T) |
Make an Eigen CSR matrix and stochastic. More... | |
void | toAndStochastic (SpMatCSC *T) |
Make an Eigen CSC matrix and stochastic. More... | |
void | filterTransitionMatrix (SpMatCSR *T, gsl_vector *rowCut, gsl_vector *colCut, double tol, int norm) |
Remove weak nodes from a transition matrix. More... | |
ATSuite Markov transition matrix manipulation routines.
Definition in file atmarkov.hpp.
void filterTransitionMatrix | ( | SpMatCSR * | T, |
gsl_vector * | rowCut, | ||
gsl_vector * | colCut, | ||
double | tol, | ||
int | norm | ||
) |
Remove weak nodes from a transition matrix based on initial and final probability of each Markov state.
[in,out] | T | The Eigen CSR transition matrix to filter. |
[in] | rowCut | The probability distribution associated with each row. |
[in] | colCut | The probability distribution associated with each column. |
[in] | tol | Probability under which Markov states are removed. |
[in] | norm | Choice of normalization,
|
Definition at line 173 of file atmarkov.hpp.
References normalizeVector(), toAndStochastic(), toLeftStochastic(), and toRightStochastic().
void toAndStochastic | ( | SpMatCSR * | T | ) |
Make an Eigen CSR matrix and stochastic by normalizing it by the sum of its elements.
[in] | T | Eigen CSR matrix to make stochastic. |
Definition at line 126 of file atmarkov.hpp.
References getSum().
Referenced by filterTransitionMatrix().
void toAndStochastic | ( | SpMatCSC * | T | ) |
Make an Eigen CSC matrix and stochastic by normalizing it by the sum of its elements.
[in] | T | Eigen CSC matrix to make stochastic. |
Definition at line 143 of file atmarkov.hpp.
void toLeftStochastic | ( | SpMatCSR * | T | ) |
Make an Eigen CSR matrix left stochastic by normalizing each column by the sum of its elements.
[in] | T | Eigen CSR matrix to make stochastic. |
Definition at line 101 of file atmarkov.hpp.
Referenced by filterTransitionMatrix(), and Grid::~Grid().
void toRightStochastic | ( | SpMatCSC * | T | ) |
Make an Eigen CSC matrix right stochastic by normalizing each row by the sum of its elements.
[in] | T | Eigen CSC matrix to make stochastic. |
Definition at line 55 of file atmarkov.hpp.
Referenced by filterTransitionMatrix().
void toRightStochastic | ( | SpMatCSR * | T | ) |
Make an Eigen CSR matrix right stochastic by normalizing each row by the sum of its elements.
[in] | T | Eigen CSR matrix to make stochastic. |
Definition at line 80 of file atmarkov.hpp.
References getRowSum(), and normalizeRows().