#include <RowMapSparseValueMatrix.h>
Inheritance diagram for PLearn::RowMapSparseValueMatrix< T >:
Public Member Functions | |
RowMapSparseValueMatrix (T value_=0, int n_rows=0, int n_columns=0) | |
RowMapSparseValueMatrix (T value_, string filename) | |
RowMapSparseValueMatrix (T value_, const Mat &m, int fill_mode=0) | |
RowMapSparseValueMatrix (T value_, const SparseMatrix &sm, int n_rows, int n_cols) | |
Accepts a FORTRAN formatted sparse matrix as an initializer. | |
Mat | toMat () |
T & | operator() (int i, int j) |
const T & | operator() (int i, int j) const |
map< int, T > & | operator() (int i) |
void | averageAcrossRowsAndColumns (Vec avg_across_rows, Vec avg_across_columns, bool only_on_non_value=false) |
real | euclidianDistance (map< int, real > &map1, map< int, real > &map2) |
Public Attributes | |
T | value |
The value of elements that is not specified is given by the field "value".
Sparse matrices implemented with STL maps.
We assume that there are elements in each ROW.
We associate an STL map to each row: column index --> value
Space used is about O( size_of_elements * number_of_non_value_elements )
Random access time is O(log(number_of_elements_per_row))
Row-wise iterations can be done in constant time per access.
Binary or ascii load/save streaming are available. Recommended filename extensions are .armsm and .brmsm respectively for Ascii Row Map Sparse Matrix or Binary Row Map Sparse Matrix.
Definition at line 75 of file RowMapSparseValueMatrix.h.
|
Definition at line 80 of file RowMapSparseValueMatrix.h. References PLearn::RowMapSparseValueMatrix< T >::value. |
|
Definition at line 84 of file RowMapSparseValueMatrix.h. References PLearn::RowMapSparseValueMatrix< T >::value. |
|
Definition at line 88 of file RowMapSparseValueMatrix.h. References PLearn::RowMapSparseMatrix< T >::length(), PLearn::Mat, PLERROR, PLearn::RowMapSparseValueMatrix< T >::value, and PLearn::RowMapSparseMatrix< T >::width(). |
|
Accepts a FORTRAN formatted sparse matrix as an initializer.
Definition at line 132 of file RowMapSparseValueMatrix.h. References PLearn::RowMapSparseValueMatrix< T >::value. |
|
average across rows on one hand, and in parallel average across columns (thus getting two averages). The boolean argument specifies whether the average is across the explicit elements (the ones not equal to "value") or across everything. Reimplemented from PLearn::RowMapSparseMatrix< T >. Definition at line 195 of file RowMapSparseValueMatrix.h. References PLearn::TVec< T >::clear(), PLearn::TVec< T >::data(), PLearn::RowMapSparseMatrix< T >::length(), PLearn::TVec< T >::resize(), PLearn::RowMapSparseValueMatrix< T >::value, PLearn::Vec, and PLearn::RowMapSparseMatrix< T >::width(). |
|
This is not a "true" euclidian distance Reimplemented from PLearn::RowMapSparseMatrix< T >. Definition at line 253 of file RowMapSparseValueMatrix.h. References PLearn::RowMapSparseValueMatrix< T >::euclidianDistance(), PLearn::sum(), and PLearn::RowMapSparseValueMatrix< T >::value. Referenced by PLearn::RowMapSparseValueMatrix< T >::euclidianDistance(). |
|
Get i-th row. Exemple to iterate on i-th row: map<int,T>& row_i = A(i); < note very important: row_i is a reference (&) map<int,T>::const_iterator it = row_i.begin(); map<int,T>::const_iterator end = row_i.end(); for (;it!=end;++it) { int j = it->first; T Aij = it->second; ... } Reimplemented from PLearn::RowMapSparseMatrix< T >. Definition at line 186 of file RowMapSparseValueMatrix.h. References PLearn::RowMapSparseValueMatrix< T >::operator()(). |
|
Reimplemented from PLearn::RowMapSparseMatrix< T >. Definition at line 161 of file RowMapSparseValueMatrix.h. References PLearn::RowMapSparseMatrix< T >::length(), PLearn::RowMapSparseValueMatrix< T >::operator()(), PLERROR, PLearn::RowMapSparseValueMatrix< T >::value, and PLearn::RowMapSparseMatrix< T >::width(). |
|
Reimplemented from PLearn::RowMapSparseMatrix< T >. Definition at line 152 of file RowMapSparseValueMatrix.h. References PLearn::RowMapSparseMatrix< T >::length(), PLearn::RowMapSparseValueMatrix< T >::operator()(), PLERROR, and PLearn::RowMapSparseMatrix< T >::width(). Referenced by PLearn::RowMapSparseValueMatrix< T >::operator()(). |
|
Reimplemented from PLearn::RowMapSparseMatrix< T >. Definition at line 136 of file RowMapSparseValueMatrix.h. References PLearn::RowMapSparseMatrix< T >::length(), PLearn::RowMapSparseValueMatrix< T >::value, and PLearn::RowMapSparseMatrix< T >::width(). |
|