MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <KinSparseMatrix.h>
Public Member Functions | |
double | computeRowRate (unsigned int row, const vector< double > &v) const |
void | fireReac (unsigned int reacIndex, vector< double > &S, double direction) const |
void | getGillespieDependence (unsigned int row, vector< unsigned int > &cols) const |
void | truncateRow (unsigned int maxColumnIndex) |
Public Member Functions inherited from SparseMatrix< int > | |
void | addRow (unsigned int rowNum, const vector< int > &row) |
void | addRow (unsigned int rowNum, const vector< int > &entry, const vector< unsigned int > &colIndexArg) |
void | clear () |
const vector< unsigned int > & | colIndex () const |
int | get (unsigned int row, unsigned int column) const |
unsigned int | getColumn (unsigned int col, vector< int > &entry, vector< unsigned int > &rowIndex) const |
unsigned int | getRow (unsigned int row, const int **entry, const unsigned int **colIndex) const |
unsigned int | getRow (unsigned int row, vector< int > &e, vector< unsigned int > &c) const |
const vector< int > & | matrixEntry () const |
Here we expose the sparse matrix for MOOSE use. More... | |
unsigned int | nColumns () const |
unsigned int | nEntries () const |
unsigned int | nRows () const |
void | pairFill (const vector< unsigned int > &row, const vector< unsigned int > &col, intvalue) |
void | print () const |
void | printInternal () const |
void | printTriplet (const vector< Triplet< int > > &t) |
void | reorderColumns (const vector< unsigned int > &colMap) |
const vector< unsigned int > & | rowStart () const |
void | set (unsigned int row, unsigned int column, intvalue) |
void | setSize (unsigned int nrows, unsigned int ncolumns) |
SparseMatrix () | |
SparseMatrix (unsigned int nrows, unsigned int ncolumns) | |
void | transpose () |
void | tripletFill (const vector< unsigned int > &row, const vector< unsigned int > &col, const vector< int > &z, bool retainSize=false) |
void | unset (unsigned int row, unsigned int column) |
Private Attributes | |
vector< unsigned int > | rowTruncated_ |
Additional Inherited Members | |
Protected Attributes inherited from SparseMatrix< int > | |
vector< unsigned int > | colIndex_ |
Non-zero entries in the SparseMatrix. More... | |
vector< int > | N_ |
unsigned int | ncolumns_ |
unsigned int | nrows_ |
vector< unsigned int > | rowStart_ |
Start index in the N_ and colIndex_ vectors, of each row. More... | |
Definition at line 13 of file KinSparseMatrix.h.
double KinSparseMatrix::computeRowRate | ( | unsigned int | row, |
const vector< double > & | v | ||
) | const |
Returns all non-zero column indices, for the specified row. This gives reac #s in orig matrix, and molecule #s in the transposed matrix Not needed. The getRow function does all this, more efficiently. int getRowIndices( unsigned int row, vector< unsigned int >& indices ); Returns the dot product of the specified row with the vector v. v corresponds to the vector of reaction rates. v must have nColumns entries.
Returns the dot product of the specified row with the vector v. v corresponds to the vector of reaction rates. v must have nColumns entries.
Definition at line 28 of file KinSparseMatrix.cpp.
References numEntries.
Referenced by VoxelPools::updateRates().
void KinSparseMatrix::fireReac | ( | unsigned int | reacIndex, |
vector< double > & | S, | ||
double | direction | ||
) | const |
Fires a stochastic reaction: It undergoes a single transition This operation updates the mol concs due to the reacn. Direction is +1 or -1, specifies direction of reaction
This too operates on the transposed matrix, because we need to get all the molecules for a given reac: a column in the original N matrix. Direction [-1,+1] specifies whether the reaction is forward or backward.
Definition at line 113 of file KinSparseMatrix.cpp.
Referenced by GssaVoxelPools::advance().
void KinSparseMatrix::getGillespieDependence | ( | unsigned int | row, |
vector< unsigned int > & | deps | ||
) | const |
Does a special self-product of the specified row. Output is the set of nonzero indices in the product abs( Rij ) * neg( Rjk ) for the specified index i, where neg( val ) is true only if val < 0.
Has to operate on transposed matrix row argument refers to reac# in this transformed situation. Fills up 'deps' with reac::s that depend on the row argument. Does NOT ensure that list is unique.
Definition at line 73 of file KinSparseMatrix.cpp.
Referenced by Gsolve::rebuildGssaSystem().
void KinSparseMatrix::truncateRow | ( | unsigned int | maxColumnIndex | ) |
This function generates a new internal list of rowEnds, such that they are all less than the maxColumnIndex. It is used because in fireReac we don't want to update all the molecules, only those that are variable.
Definition at line 141 of file KinSparseMatrix.cpp.
Referenced by Gsolve::rebuildGssaSystem().
|
private |
End colIndex for rows (molecules in the transposed matrix) so that only variable molecules are below the colIndex.
Definition at line 69 of file KinSparseMatrix.h.