#include <plearn/base/general.h>
#include "DoubleAccessSparseMatrix_impl.h"
Include dependency graph for DoubleAccessSparseMatrix.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Namespaces | |
namespace | PLearn |
Defines | |
#define | ROW_WISE -1000 |
#define | COLUMN_WISE -2000 |
Definition in file DoubleAccessSparseMatrix.h.
|
|
This is a sparse matrix implemented as a STL vector of STL maps. Thus, each element of the vector is a sparse vector that only holds non-null elements (no space is wasted for null elements, as their "existance" is marked by their absence from the table). For conveniance, it is accessible column-wise, row-wise, or both. If you want to manipulate the sparse matrix with both accesses, note that there is an important space trade-off, because of the need of keeping two separate tables in memory (one being simply the transpose of the other). There are two flags for manipulating the access and preferences for the possible operations that can be applied to the matrix. The first one is the boolean 'double_access' : if it is set to 'true', the matrix can be acessed either by its columns or by its rows. The second flag that must be set is 'mode' (that can take the values ROW_WISE or COLUMN_WISE) : it plays two roles, depending on the value of 'double_access'. (1) If 'double_access' is set to 'false', 'mode' will determine which of both matrices is the one to work with. (2) If 'double_access' is set to 'true', it will determine the preference of certain access-specific operations. The sub-class ProbSparseMatrix will for example take some actions depending on its value. Note that you can define the null-element (of parametrized type T) to be anything that you wish. When 'setting' or 'getting' the matrix, this user-defined null-element will be used for the comparison. (Thus you can have, if you wish, a sparse matrix full of 1s, with only sparse 0s). Definition at line 73 of file DoubleAccessSparseMatrix.h. Referenced by PLearn::DoubleAccessSparseMatrix< T >::addCol(), PLearn::ComplementedProbSparseMatrix::checkCondProbIntegrity(), PLearn::SmoothedProbSparseMatrix::checkCondProbIntegrity(), PLearn::ProbSparseMatrix::checkCondProbIntegrity(), PLearn::DoubleAccessSparseMatrix< T >::clear(), PLearn::DoubleAccessSparseMatrix< T >::clearCol(), PLearn::DoubleAccessSparseMatrix< T >::clearElem(), PLearn::ComplementedProbSparseMatrix::complement(), PLearn::DoubleAccessSparseMatrix< T >::DoubleAccessSparseMatrix(), PLearn::DoubleAccessSparseMatrix< T >::exists(), PLearn::ComplementedProbSparseMatrix::get(), PLearn::SmoothedProbSparseMatrix::get(), PLearn::DoubleAccessSparseMatrix< T >::get(), PLearn::DoubleAccessSparseMatrix< T >::getAsCompressedVec(), PLearn::DoubleAccessSparseMatrix< T >::getAsMaxSizedCompressedVecs(), PLearn::DoubleAccessSparseMatrix< T >::getRow(), PLearn::ProbSparseMatrix::normalizeCond(), PLearn::SmoothedProbSparseMatrix::normalizeCondBackoff(), PLearn::SmoothedProbSparseMatrix::normalizeCondLaplace(), PLearn::ProbSparseMatrix::normalizeJoint(), PLearn::DoubleAccessSparseMatrix< T >::resize(), PLearn::DoubleAccessSparseMatrix< T >::set(), PLearn::DoubleAccessSparseMatrix< T >::setDoubleAccessible(), PLearn::DoubleAccessSparseMatrix< T >::setMode(), PLearn::DoubleAccessSparseMatrix< T >::size(), PLearn::DoubleAccessSparseMatrix< T >::sumOfElements(), and PLearn::DoubleAccessSparseMatrix< T >::sumRow(). |