|
SHOGUN
v2.1.0
|
template class SGSparseMatrix
Definition at line 27 of file SGSparseMatrix.h.

Public Member Functions | |
| SGSparseMatrix () | |
| SGSparseMatrix (SGSparseVector< T > *vecs, index_t num_feat, index_t num_vec, bool ref_counting=true) | |
| SGSparseMatrix (index_t num_feat, index_t num_vec, bool ref_counting=true) | |
| SGSparseMatrix (const SGSparseMatrix &orig) | |
| virtual | ~SGSparseMatrix () |
| const SGSparseVector< T > & | operator[] (index_t index) const |
| SGSparseVector< T > & | operator[] (index_t index) |
| SGSparseMatrix< T > | get () |
| void | load (CFile *loader) |
| void | save (CFile *saver) |
| int32_t | ref_count () |
Public Attributes | |
| index_t | num_vectors |
| total number of vectors | |
| index_t | num_features |
| total number of features | |
| SGSparseVector< T > * | sparse_matrix |
| array of sparse vectors of size num_vectors | |
Protected Member Functions | |
| virtual void | copy_data (const SGReferencedData &orig) |
| virtual void | init_data () |
| virtual void | free_data () |
| void | copy_refcount (const SGReferencedData &orig) |
| int32_t | ref () |
| int32_t | unref () |
| SGSparseMatrix | ( | ) |
default constructor
Definition at line 8 of file SGSparseMatrix.cpp.
| SGSparseMatrix | ( | SGSparseVector< T > * | vecs, |
| index_t | num_feat, | ||
| index_t | num_vec, | ||
| bool | ref_counting = true |
||
| ) |
constructor for setting params
Definition at line 14 of file SGSparseMatrix.cpp.
| SGSparseMatrix | ( | index_t | num_feat, |
| index_t | num_vec, | ||
| bool | ref_counting = true |
||
| ) |
constructor to create new matrix in memory
Definition at line 23 of file SGSparseMatrix.cpp.
| SGSparseMatrix | ( | const SGSparseMatrix< T > & | orig | ) |
copy constructor
Definition at line 31 of file SGSparseMatrix.cpp.
|
virtual |
destructor
Definition at line 37 of file SGSparseMatrix.cpp.
|
protectedvirtual |
|
protectedinherited |
copy refcount
Definition at line 67 of file SGReferencedData.cpp.
|
protectedvirtual |
| SGSparseMatrix<T> get | ( | ) |
get the sparse matrix (no copying is done here)
Definition at line 63 of file SGSparseMatrix.h.
|
protectedvirtual |
| void load | ( | CFile * | loader | ) |
load sparse matrix from file
| loader | File object via which to load data |
Definition at line 43 of file SGSparseMatrix.cpp.
| const SGSparseVector<T>& operator[] | ( | index_t | index | ) | const |
index access operator
Definition at line 47 of file SGSparseMatrix.h.
| SGSparseVector<T>& operator[] | ( | index_t | index | ) |
index access operator
Definition at line 53 of file SGSparseMatrix.h.
|
protectedinherited |
increase reference counter
Definition at line 76 of file SGReferencedData.cpp.
|
inherited |
display reference counter
Definition at line 47 of file SGReferencedData.cpp.
| void save | ( | CFile * | saver | ) |
save sparse matrix to file
| saver | File object via which to save data |
Definition at line 54 of file SGSparseMatrix.cpp.
|
protectedinherited |
decrement reference counter and deallocate object if refcount is zero before or after decrementing it
Definition at line 101 of file SGReferencedData.cpp.
| index_t num_features |
total number of features
Definition at line 97 of file SGSparseMatrix.h.
| index_t num_vectors |
total number of vectors
Definition at line 94 of file SGSparseMatrix.h.
| SGSparseVector<T>* sparse_matrix |
array of sparse vectors of size num_vectors
Definition at line 100 of file SGSparseMatrix.h.