SHOGUN  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Defines
LibSVMFile.cpp File Reference

Go to the source code of this file.

Defines

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

Define Documentation

#define GET_LABELED_SPARSE_MATRIX (   read_func,
  sg_type 
)

Definition at line 99 of file LibSVMFile.cpp.

#define GET_SPARSE_MATRIX (   read_func,
  sg_type 
)
Value:
void CLibSVMFile::get_sparse_matrix(SGSparseVector<sg_type>*& matrix, int32_t& num_feat, int32_t& num_vec) \
{ \
    float64_t* labels=NULL; \
    get_sparse_matrix(matrix, num_feat, num_vec, labels, false); \
}

Definition at line 77 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) \
{ \
    SG_SET_LOCALE_C; \
    \
    for (int32_t i=0; i<num_vec; i++) \
    { \
        if (labels!=NULL) \
            fprintf(file, "%lg ", labels[i]); \
        \
        for (int32_t j=0; j<matrix[i].num_feat_entries; j++) \
        { \
            fprintf(file, "%d%c%" format " ", \
                matrix[i].features[j].feat_index+1, \
                m_delimiter, \
                matrix[i].features[j].entry); \
        } \
        fprintf(file, "\n"); \
    } \
    \
    SG_RESET_LOCALE; \
}

Definition at line 205 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) \
{ \
    set_sparse_matrix(matrix, num_feat, num_vec, NULL); \
}

Definition at line 183 of file LibSVMFile.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation