16 #ifndef SPARSEMATRIX_H
17 #define SPARSEMATRIX_H
19 #include "transitionStructure.h"
80 bool setEntry(
int row,
int col,
double val);
102 int getCol(
int row,
int numCol );
188 void write(FILE* out, std::string format);
199 bool addToEntry(
int row,
int col,
double val);
214 int consolidate(
int i,
int* destinations,
double* values);
224 #endif // SPARSEMATRIX_H
void evaluateMeasure(double *m, double *res)
Sparse vector/matrix multiplication. The result is stored in an array that must be already allocated...
Definition: sparseMatrix.cpp:321
double rowSum(int row)
Summing a row.
Definition: sparseMatrix.cpp:308
sparseMatrix(int size)
Standard constructor for sparse matrices. The internal structures are initialized. The result is the null matrix.
Definition: sparseMatrix.cpp:30
int getCol(int row, int numCol)
Retrieving an low-level entry from the matrix.
Definition: sparseMatrix.cpp:222
bool setEntry(int row, int col, double val)
Inserting an element in the matrix. IMPORTANT NOTE: there is no check for the existence of the column...
Definition: sparseMatrix.cpp:113
void normalize()
Method to normalize transition probabilities/rates across the matrix. The normalized form has strictl...
Definition: sparseMatrix.cpp:751
void write(FILE *out, std::string format)
Writing a sparse matrix to a file. Several formats could be chosen. Supported formats are: "Ers"...
Definition: sparseMatrix.cpp:545
discreteDistribution * getTransDistrib(int row)
Retrieving the transitions from some state as a discrete distribution.
Definition: sparseMatrix.cpp:254
sparseMatrix * uniformize()
Sparse matrix uniformization. Returns a sparse matrix and sets the uniformization factor...
Definition: sparseMatrix.cpp:383
int getNbElts(int row)
Retrieving a the number of elements on some row.
Definition: sparseMatrix.cpp:205
sparseMatrix * copy()
Sparse matrix copy. This is a straightforward copy. No optimization is performed, viz replicated colu...
Definition: sparseMatrix.cpp:365
void diagnose(FILE *out)
Performs various diagnostics on the transition structure (only written for sparseMatrix objects at th...
Definition: sparseMatrix.cpp:480
~sparseMatrix()
Destructor of the class.
Definition: sparseMatrix.cpp:97
double getEntry(int, int)
Retrieving an entry from the matrix. Takes into account the fact that columns may be replicated: the ...
Definition: sparseMatrix.cpp:190
Abstract class for transition structures. These are structures which describe transitions to one stat...
Definition: transitionStructure.h:33
void evaluateValue(double *v, double *res)
Sparse vector/matrix multiplication. The result is stored in an array that must be already allocated...
Definition: sparseMatrix.cpp:354
bool addToEntry(int row, int col, double val)
Adding a value to an element to the matrix.
Definition: sparseMatrix.cpp:145
sparseMatrix * embed()
Sparse matrix embedding. Returns a sparse matrix. If the type is already discrete, returns a copy.
Definition: sparseMatrix.cpp:438
Class sparseMatrix: implementation of a transition structure using the sparse matrix data structure...
Definition: sparseMatrix.h:29
int size()
Read accessor for the size of the state space. This is the origin state space by default.
Definition: transitionStructure.h:59
The general discrete distribution with finite support.
Definition: discreteDistribution.h:25
double getEntryByCol(int row, int numCol)
Retrieving an low-level entry from the matrix.
Definition: sparseMatrix.cpp:238