SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros
LibSVMFile.cpp File Reference

Go to the source code of this file.

Macros

#define GET_SPARSE_MATRIX(read_func, sg_type)
 
#define GET_LABELED_SPARSE_MATRIX(read_func, sg_type)
 
#define GET_MULTI_LABELED_SPARSE_MATRIX(read_func, sg_type)
 
#define SET_SPARSE_MATRIX(format, sg_type)
 
#define SET_LABELED_SPARSE_MATRIX(format, sg_type)
 
#define SET_MULTI_LABELED_SPARSE_MATRIX(format, sg_type)
 

Macro Definition Documentation

#define GET_LABELED_SPARSE_MATRIX (   read_func,
  sg_type 
)
Value:
void CLibSVMFile::get_sparse_matrix(SGSparseVector<sg_type>*& mat_feat, int32_t& num_feat, int32_t& num_vec, \
float64_t*& labels, bool load_labels) \
{ \
SGVector<float64_t>* multilabel; \
int32_t num_classes; \
get_sparse_matrix(mat_feat, num_feat, num_vec, multilabel, num_classes, load_labels); \
\
for (int32_t i=0; i<num_vec; i++) \
{ \
REQUIRE(multilabel[i].size()==1, \
"%s a multilabel file. You are trying to read it with a single-label reader.", filename); \
} \
labels=SG_MALLOC(float64_t, num_vec); \
\
for (int32_t i=0; i<num_vec; i++) \
labels[i]=multilabel[i][0]; \
SG_FREE(multilabel); \
} \
#define REQUIRE(x,...)
Definition: SGIO.h:206
double float64_t
Definition: common.h:50
template class SGSparseVector The assumtion is that the stored SGSparseVectorEntry* vector is orde...

Definition at line 111 of file LibSVMFile.cpp.

#define GET_MULTI_LABELED_SPARSE_MATRIX (   read_func,
  sg_type 
)

Definition at line 146 of file LibSVMFile.cpp.

#define GET_SPARSE_MATRIX (   read_func,
  sg_type 
)
Value:
void CLibSVMFile::get_sparse_matrix(SGSparseVector<sg_type>*& mat_feat, int32_t& num_feat, int32_t& num_vec) \
{ \
SGVector<float64_t>* multilabel; \
int32_t num_classes; \
get_sparse_matrix(mat_feat, num_feat, num_vec, multilabel, num_classes, false); \
}
template class SGSparseVector The assumtion is that the stored SGSparseVectorEntry* vector is orde...

Definition at line 88 of file LibSVMFile.cpp.

#define SET_LABELED_SPARSE_MATRIX (   format,
  sg_type 
)
Value:
void CLibSVMFile::set_sparse_matrix( \
const SGSparseVector<sg_type>* matrix, int32_t num_feat, int32_t num_vec, \
const float64_t* labels) \
{ \
SGVector<float64_t>* multilabel=SG_MALLOC(SGVector<float64_t>, num_vec); \
\
for (int32_t i=0; i<num_vec; i++) \
{ \
multilabel[i]=SGVector<float64_t>(1); \
multilabel[i][0]=labels[i]; \
} \
\
set_sparse_matrix(matrix, num_feat, num_vec, multilabel); \
SG_FREE(multilabel); \
}
double float64_t
Definition: common.h:50
template class SGSparseVector The assumtion is that the stored SGSparseVectorEntry* vector is orde...

Definition at line 292 of file LibSVMFile.cpp.

#define SET_MULTI_LABELED_SPARSE_MATRIX (   format,
  sg_type 
)

Definition at line 324 of file LibSVMFile.cpp.

#define SET_SPARSE_MATRIX (   format,
  sg_type 
)
Value:
void CLibSVMFile::set_sparse_matrix( \
const SGSparseVector<sg_type>* matrix, int32_t num_feat, int32_t num_vec) \
{ \
SGVector <float64_t>* labels = NULL; \
set_sparse_matrix(matrix, num_feat, num_vec, labels); \
}
template class SGSparseVector The assumtion is that the stored SGSparseVectorEntry* vector is orde...

Definition at line 269 of file LibSVMFile.cpp.


SHOGUN Machine Learning Toolbox - Documentation