MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <SparseMatrix.h>
Public Member Functions | |
void | addRow (unsigned int rowNum, const vector< T > &row) |
void | addRow (unsigned int rowNum, const vector< T > &entry, const vector< unsigned int > &colIndexArg) |
void | clear () |
const vector< unsigned int > & | colIndex () const |
T | get (unsigned int row, unsigned int column) const |
unsigned int | getColumn (unsigned int col, vector< T > &entry, vector< unsigned int > &rowIndex) const |
unsigned int | getRow (unsigned int row, const T **entry, const unsigned int **colIndex) const |
unsigned int | getRow (unsigned int row, vector< T > &e, vector< unsigned int > &c) const |
const vector< T > & | 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, T value) |
void | print () const |
void | printInternal () const |
void | printTriplet (const vector< Triplet< T > > &t) |
void | reorderColumns (const vector< unsigned int > &colMap) |
const vector< unsigned int > & | rowStart () const |
void | set (unsigned int row, unsigned int column, T value) |
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< T > &z, bool retainSize=false) |
void | unset (unsigned int row, unsigned int column) |
Protected Attributes | |
vector< unsigned int > | colIndex_ |
Non-zero entries in the SparseMatrix. More... | |
vector< T > | 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 63 of file SparseMatrix.h.
|
inline |
Definition at line 69 of file SparseMatrix.h.
|
inline |
Definition at line 78 of file SparseMatrix.h.
|
inline |
Adds a row to the sparse matrix, must go strictly in row order. This is dangerous as there is a test for an empty entry ~0. For many types, ~0 may actually be a perfectly legal entry.
Definition at line 387 of file SparseMatrix.h.
Referenced by MeshCompt::addRow(), MeshCompt::extendStencil(), and SparseMsg::randomConnect().
|
inline |
Used to set an entire row of entries, already in sparse form. Assumes that the SparseMatrix has been suitably allocated. rowNum must be done in increasing order in successive calls.
Definition at line 410 of file SparseMatrix.h.
|
inline |
Definition at line 443 of file SparseMatrix.h.
Referenced by SparseMsg::clear(), MeshCompt::extendStencil(), SparseMsg::randomConnect(), MeshCompt::setStencilSize(), and testSparseMatrix2().
|
inline |
Definition at line 431 of file SparseMatrix.h.
Referenced by SparseMsg::getColIndex(), Stoich::getColIndex(), and SparseMsg::getEntryPairs().
|
inline |
Returns the entry identified by row, column. Returns T(0) if not found
Definition at line 253 of file SparseMatrix.h.
Referenced by Stoich::innerInstallReaction(), Stoich::installAndUnschedFuncRate(), Stoich::installEnzyme(), Stoich::installMMenz(), main(), printSparseMatrix(), testFastMatrixElim(), testSetDiffusionAndTransport(), testSparseMatrix2(), testSparseMatrixFill(), and testSparseMatrixReorder().
|
inline |
This is an unnatural lookup here, across the grain of the sparse matrix. Ideally should use copy_if, but the C++ chaps forgot it.
Definition at line 342 of file SparseMatrix.h.
Referenced by SparseMsg::findOtherEnd().
|
inline |
Used to get an entire row of entries. Returns # entries. Passes back iterators for the row and for the column index.
Ideally I should provide a forall type function so that the user passes in their operation as a functor, and it is applied to the entire row.
Definition at line 288 of file SparseMatrix.h.
Referenced by MeshCompt::extendStencil(), fillErefsFromMatrix(), Gsolve::fillIncrementFuncDep(), Gsolve::fillMmEnzDep(), Gsolve::fillPoolFuncDep(), SparseMsg::findOtherEnd(), SparseMsg::firstTgt(), MeshCompt::getNeighbors(), MeshCompt::getStencilRow(), MeshCompt::innerGetStencilRate(), printSparseMatrix(), SparseMatrix< unsigned int >::reorderColumns(), FastElim::shuffleRows(), FastMatrixElim::shuffleRows(), testSparseMatrix(), and SparseMsg::updateAfterFill().
|
inline |
getRow: vector version. Used to get an entire row of entries. Returns # entries.
Definition at line 314 of file SparseMatrix.h.
|
inline |
Here we expose the sparse matrix for MOOSE use.
Definition at line 427 of file SparseMatrix.h.
Referenced by SparseMsg::getMatrixEntry(), and Stoich::getMatrixEntry().
|
inline |
Definition at line 92 of file SparseMatrix.h.
Referenced by fillErefsFromMatrix(), SparseMsg::getNumColumns(), printSparseMatrix(), SparseMsg::randomConnect(), testSparseMatrix(), testSparseMatrixFill(), testSparseMatrixReorder(), VoxelPools::updateRates(), GssaVoxelPools::updateReacVelocities(), and VoxelPools::updateReacVelocities().
|
inline |
Definition at line 97 of file SparseMatrix.h.
Referenced by SparseMsg::firstTgt(), SparseMsg::getNumEntries(), and testSparseMatrixFill().
|
inline |
Definition at line 87 of file SparseMatrix.h.
Referenced by MeshCompt::extendStencil(), fillErefsFromMatrix(), SparseMsg::getEntryPairs(), SparseMsg::getNumRows(), printSparseMatrix(), SparseMsg::randomConnect(), testSparseMatrix(), testSparseMatrixFill(), testSparseMatrixReorder(), SparseMsg::updateAfterFill(), and VoxelPools::updateRates().
|
inline |
Definition at line 627 of file SparseMatrix.h.
|
inline |
Prints out the contents in matrix form
Definition at line 650 of file SparseMatrix.h.
Referenced by Dsolve::build(), main(), and Stoich::print().
|
inline |
Prints out the contents in internal form
Definition at line 681 of file SparseMatrix.h.
|
inline |
Definition at line 638 of file SparseMatrix.h.
|
inline |
Reorder columns from the matrix based on a map of old to new column indices. newCols contains the indices of columns from the old matrix that are to be retained, in the order that they will occupy in the new matrix. It can have fewer or more indices than the original.
Definition at line 533 of file SparseMatrix.h.
Referenced by testSparseMatrix(), testSparseMatrix2(), and testSparseMatrixReorder().
|
inline |
Definition at line 435 of file SparseMatrix.h.
Referenced by SparseMsg::getEntryPairs(), SparseMsg::getRowStart(), and Stoich::getRowStart().
|
inline |
Assigns and if necessary adds an entry in the matrix. This variant does NOT remove any existing entry.
Definition at line 161 of file SparseMatrix.h.
Referenced by Stoich::innerInstallReaction(), Stoich::installAndUnschedFuncRate(), Stoich::installEnzyme(), Stoich::installMMenz(), SparseMsg::setEntry(), testSparseMatrix(), testSparseMatrix2(), and testSparseMatrixReorder().
|
inline |
Should be called only at the start. Subsequent resizing destroys the contents.
Definition at line 126 of file SparseMatrix.h.
Referenced by MeshCompt::extendStencil(), Stoich::resizeArrays(), MeshCompt::setStencilSize(), SparseMsg::SparseMsg(), testSparseMatrix2(), and testSparseMatrixReorder().
|
inline |
Does a transpose, using as workspace a vector of size 3 N_ 0257 -> 0011122
Definition at line 456 of file SparseMatrix.h.
Referenced by FastMatrixElim::checkSymmetricShape(), FastMatrixElim::isSymmetric(), SparseMsg::randomConnect(), Gsolve::rebuildGssaSystem(), SparseMsg::sources(), testSparseMatrix(), testSparseMatrix2(), SparseMsg::transpose(), and SparseMsg::updateAfterFill().
|
inline |
Definition at line 583 of file SparseMatrix.h.
Referenced by SparseMsg::pairFill(), testSparseMatrixFill(), and SparseMsg::tripletFill().
|
inline |
Removes specified entry.
Definition at line 212 of file SparseMatrix.h.
Referenced by SparseMsg::unsetEntry().
|
protected |
Non-zero entries in the SparseMatrix.
Definition at line 709 of file SparseMatrix.h.
Referenced by FastMatrixElim::checkSymmetricShape(), FastMatrixElim::operator==(), and FastMatrixElim::setDiffusionAndTransport().
|
protected |
Definition at line 703 of file SparseMatrix.h.
Referenced by FastMatrixElim::checkSymmetricShape(), FastMatrixElim::operator==(), and FastMatrixElim::setDiffusionAndTransport().
|
protected |
Definition at line 702 of file SparseMatrix.h.
Referenced by FastMatrixElim::checkSymmetricShape(), FastMatrixElim::operator==(), SparseMatrix< unsigned int >::reorderColumns(), and FastMatrixElim::setDiffusionAndTransport().
|
protected |
Definition at line 701 of file SparseMatrix.h.
Referenced by FastMatrixElim::checkSymmetricShape(), FastMatrixElim::operator==(), SparseMatrix< unsigned int >::reorderColumns(), FastMatrixElim::setDiffusionAndTransport(), FastElim::shuffleRows(), and FastMatrixElim::shuffleRows().
|
protected |
Start index in the N_ and colIndex_ vectors, of each row.
Definition at line 712 of file SparseMatrix.h.
Referenced by FastMatrixElim::checkSymmetricShape(), FastMatrixElim::operator==(), and FastMatrixElim::setDiffusionAndTransport().