SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
所有成员列表 | Public 成员函数 | Public 属性 | Protected 成员函数
SGSparseMatrix< T > Singleton Reference

详细描述

template<class T>
singleton shogun::SGSparseMatrix< T >

template class SGSparseMatrix

在文件 base/Parameter.h27 行定义.

类 SGSparseMatrix< T > 继承关系图:
Inheritance graph
[图例]

Public 成员函数

 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 (SGMatrix< T > dense)
 
 SGSparseMatrix (const SGSparseMatrix &orig)
 
virtual ~SGSparseMatrix ()
 
const SGSparseVector< T > & operator[] (index_t index) const
 
SGSparseVector< T > & operator[] (index_t index)
 
SGSparseMatrix< T > get ()
 
const SGVector< T > operator* (SGVector< T > v) const
 
template<class ST >
const SGVector< T > operator* (SGVector< ST > v) const
 
const T operator() (index_t i_row, index_t i_col) const
 
T & operator() (index_t i_row, index_t i_col)
 
void load (CFile *loader)
 
SGVector< float64_tload_with_labels (CLibSVMFile *libsvm_file, bool do_sort_features=true)
 
void save (CFile *saver)
 
void save_with_labels (CLibSVMFile *saver, SGVector< float64_t > labels)
 
SGSparseMatrix< T > get_transposed ()
 
void from_dense (SGMatrix< T > full)
 
void sort_features ()
 
template<>
const SGVector< complex128_toperator* (SGVector< float64_t > v) const
 
template<>
const SGVector< complex128_toperator* (SGVector< int32_t > v) const
 
template<>
const SGVector< float64_toperator* (SGVector< int32_t > v) const
 
template<>
void load (CFile *loader)
 
template<>
SGVector< float64_tload_with_labels (CLibSVMFile *file, bool do_sort_features)
 
template<>
void save (CFile *saver)
 
template<>
void save_with_labels (CLibSVMFile *saver, SGVector< float64_t > labels)
 
int32_t ref_count ()
 

Public 属性

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 成员函数

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 ()
 

构造及析构函数说明

default constructor

在文件 SGSparseMatrix.cpp11 行定义.

SGSparseMatrix ( SGSparseVector< T > *  vecs,
index_t  num_feat,
index_t  num_vec,
bool  ref_counting = true 
)

constructor for setting params

在文件 SGSparseMatrix.cpp17 行定义.

SGSparseMatrix ( index_t  num_feat,
index_t  num_vec,
bool  ref_counting = true 
)

constructor to create new matrix in memory

在文件 SGSparseMatrix.cpp26 行定义.

SGSparseMatrix ( SGMatrix< T >  dense)

constructor to create new sparse matrix from a dense one

参数
densedense matrix to be converted

在文件 SGSparseMatrix.cpp34 行定义.

SGSparseMatrix ( const SGSparseMatrix< T > &  orig)

copy constructor

在文件 SGSparseMatrix.cpp40 行定义.

~SGSparseMatrix ( )
virtual

destructor

在文件 SGSparseMatrix.cpp46 行定义.

成员函数说明

void copy_data ( const SGReferencedData orig)
protectedvirtual

copy data

实现了 SGReferencedData.

在文件 SGSparseMatrix.cpp159 行定义.

void copy_refcount ( const SGReferencedData orig)
protectedinherited

copy refcount

在文件 SGReferencedData.cpp55 行定义.

void free_data ( )
protectedvirtual

free data

实现了 SGReferencedData.

在文件 SGSparseMatrix.cpp175 行定义.

void from_dense ( SGMatrix< T >  full)

create a sparse matrix from a dense one

参数
fullthe dense matrix to create the sparse one from

在文件 SGSparseMatrix.cpp232 行定义.

SGSparseMatrix<T> get ( )

get the sparse matrix (no copying is done here)

返回
the refcount increased matrix

在文件 SGSparseMatrix.h75 行定义.

SGSparseMatrix< T > get_transposed ( )

return the transposed of the sparse matrix

在文件 SGSparseMatrix.cpp182 行定义.

void init_data ( )
protectedvirtual

init data

实现了 SGReferencedData.

在文件 SGSparseMatrix.cpp167 行定义.

void load ( CFile loader)

在文件 SGSparseMatrix.cpp102 行定义.

void load ( CFile loader)

load sparse matrix from file

参数
loaderFile object via which to load data

在文件 SGSparseMatrix.cpp91 行定义.

SGVector< float64_t > load_with_labels ( CLibSVMFile file,
bool  do_sort_features 
)

在文件 SGSparseMatrix.cpp123 行定义.

SGVector< float64_t > load_with_labels ( CLibSVMFile libsvm_file,
bool  do_sort_features = true 
)

load sparse matrix from libsvm file together with labels

参数
libsvm_filethe libsvm file
do_sort_featureswhether to sort the vector indices (such that they are in ascending order) after loading
返回
label vector

在文件 SGSparseMatrix.cpp107 行定义.

const T operator() ( index_t  i_row,
index_t  i_col 
) const

operator overload for sparse-matrix read only access

参数
i_row
i_col

在文件 SGSparseMatrix.h106 行定义.

T& operator() ( index_t  i_row,
index_t  i_col 
)

operator overload for sparse-matrix r/w access

参数
i_row
i_col

在文件 SGSparseMatrix.h127 行定义.

const SGVector< complex128_t > operator* ( SGVector< float64_t v) const

在文件 SGSparseMatrix.cpp52 行定义.

const SGVector< complex128_t > operator* ( SGVector< int32_t >  v) const

在文件 SGSparseMatrix.cpp65 行定义.

const SGVector< float64_t > operator* ( SGVector< int32_t >  v) const

在文件 SGSparseMatrix.cpp78 行定义.

const SGVector<T> operator* ( SGVector< T >  v) const

compute sparse-matrix dense-vector multiplication

参数
vthe dense-vector to be multiplied with
返回
the result vector \(Q*v\), Q being this sparse matrix

在文件 SGSparseMatrix.h84 行定义.

const SGVector<T> operator* ( SGVector< ST >  v) const

compute sparse-matrix dense-vector multiplication

参数
vthe dense-vector to be multiplied with
返回
the result vector \(Q*v\), Q being this sparse matrix
const SGSparseVector<T>& operator[] ( index_t  index) const

index access operator

在文件 SGSparseMatrix.h59 行定义.

SGSparseVector<T>& operator[] ( index_t  index)

index access operator

在文件 SGSparseMatrix.h65 行定义.

int32_t ref ( )
protectedinherited

increase reference counter

返回
reference count

在文件 SGReferencedData.cpp64 行定义.

int32_t ref_count ( )
inherited

display reference counter

返回
reference count

在文件 SGReferencedData.cpp41 行定义.

void save ( CFile saver)

在文件 SGSparseMatrix.cpp137 行定义.

void save ( CFile saver)

save sparse matrix to file

参数
saverFile object via which to save data

在文件 SGSparseMatrix.cpp127 行定义.

void save_with_labels ( CLibSVMFile saver,
SGVector< float64_t labels 
)

在文件 SGSparseMatrix.cpp155 行定义.

void save_with_labels ( CLibSVMFile saver,
SGVector< float64_t labels 
)

save sparse matrix together with labels to file

参数
saverFile object via which to save data
labelslabel vector

在文件 SGSparseMatrix.cpp142 行定义.

void sort_features ( )

sort the indices of the sparse matrix such that they are in ascending order

在文件 SGSparseMatrix.cpp224 行定义.

int32_t unref ( )
protectedinherited

decrement reference counter and deallocate object if refcount is zero before or after decrementing it

返回
reference count

在文件 SGReferencedData.cpp84 行定义.

类成员变量说明

index_t num_features

total number of features

在文件 SGSparseMatrix.h207 行定义.

index_t num_vectors

total number of vectors

在文件 SGSparseMatrix.h204 行定义.

SGSparseVector<T>* sparse_matrix

array of sparse vectors of size num_vectors

在文件 SGSparseMatrix.h210 行定义.


The documentation for this singleton was generated from the following files:

SHOGUN 机器学习工具包 - 项目文档