13 #ifndef __SGSPARSEMATRIX_H__ 14 #define __SGSPARSEMATRIX_H__ 25 template <
class T>
class SGSparseVector;
26 template<
class T>
class SGMatrix;
29 class CRegressionLabels;
32 template <
class T>
class SGSparseMatrix :
public SGReferencedData
40 index_t num_vec,
bool ref_counting=
true);
87 "Dimension mismatch! %d vs %d\n",
107 REQUIRE(i_row>=0,
"index %d negative!\n", i_row);
108 REQUIRE(i_col>=0,
"index %d negative!\n", i_col);
128 REQUIRE(i_row>=0,
"index %d negative!\n", i_row);
129 REQUIRE(i_col>=0,
"index %d negative!\n", i_col);
214 #endif // __SGSPARSEMATRIX_H__
template class SGSparseMatrix
void save_with_labels(CLibSVMFile *saver, SGVector< float64_t > labels)
SGSparseVector< T > * sparse_matrix
array of sparse vectors of size num_vectors
index_t num_vectors
total number of vectors
SGSparseVector< T > & operator[](index_t index)
virtual void copy_data(const SGReferencedData &orig)
template class SGSparseVector The assumtion is that the stored SGSparseVectorEntry<T>* vector is orde...
virtual ~SGSparseMatrix()
const SGSparseVector< T > & operator[](index_t index) const
shogun reference count managed data
A File access base class.
index_t num_features
total number of features
const T operator()(index_t i_row, index_t i_col) const
void from_dense(SGMatrix< T > full)
T & operator()(index_t i_row, index_t i_col)
const SGVector< T > operator*(SGVector< T > v) const
all of classes and functions are contained in the shogun namespace
read sparse real valued features in svm light format e.g. -1 1:10.0 2:100.2 1000:1.3 with -1 == (optional) label and dim 1 - value 10.0 dim 2 - value 100.2 dim 1000 - value 1.3
template class SGSparseVectorEntry
SGSparseMatrix< T > get_transposed()
SGVector< float64_t > load_with_labels(CLibSVMFile *libsvm_file, bool do_sort_features=true)