SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros
CSVFile.cpp File Reference

Go to the source code of this file.

Macros

#define GET_VECTOR(read_func, sg_type)
#define GET_MATRIX(read_func, sg_type)
#define GET_NDARRAY(read_func, sg_type)
#define GET_SPARSE_MATRIX(read_func, sg_type)
#define SET_VECTOR(format, sg_type)
#define SET_MATRIX(format, sg_type)
#define SET_SPARSE_MATRIX(format, sg_type)
#define GET_STRING_LIST(sg_type)
#define SET_STRING_LIST(sg_type)

Macro Definition Documentation

#define GET_MATRIX (   read_func,
  sg_type 
)

Definition at line 180 of file CSVFile.cpp.

#define GET_NDARRAY (   read_func,
  sg_type 
)
Value:
void CCSVFile::get_ndarray(sg_type*& array, int32_t*& dims, int32_t& num_dims) \
{ \
SG_NOTIMPLEMENTED \
}

Definition at line 241 of file CSVFile.cpp.

#define GET_SPARSE_MATRIX (   read_func,
  sg_type 
)
Value:
void CCSVFile::get_sparse_matrix( \
SGSparseVector<sg_type>*& matrix, int32_t& num_feat, int32_t& num_vec) \
{ \
SG_NOTIMPLEMENTED \
}

Definition at line 256 of file CSVFile.cpp.

#define GET_STRING_LIST (   sg_type)
Value:
void CCSVFile::get_string_list( \
SGString<sg_type>*& strings, int32_t& num_str, \
int32_t& max_string_len) \
{ \
SG_NOTIMPLEMENTED \
}

Definition at line 408 of file CSVFile.cpp.

#define GET_VECTOR (   read_func,
  sg_type 
)
Value:
void CCSVFile::get_vector(sg_type*& vector, int32_t& len) \
{ \
if (!m_line_reader->has_next()) \
return; \
\
int32_t num_feat=0; \
int32_t num_vec=0; \
get_matrix(vector, num_feat, num_vec); \
\
if (num_feat==1) \
{ \
len=num_vec; \
return; \
} \
\
if (num_vec==1) \
{ \
len=num_feat; \
return; \
} \
\
len=0; \
}

Definition at line 141 of file CSVFile.cpp.

#define SET_MATRIX (   format,
  sg_type 
)
Value:
void CCSVFile::set_matrix(const sg_type* matrix, int32_t num_feat, int32_t num_vec) \
{ \
SG_SET_LOCALE_C; \
\
if (!is_data_transposed) \
{ \
for (int32_t i=0; i<num_vec; i++) \
{ \
int32_t j; \
for (j=0; j<num_feat-1; j++) \
fprintf(file, "%" format "%c", matrix[j+i*num_feat], m_delimiter); \
fprintf(file, "%" format "\n", matrix[j+i*num_feat]); \
} \
} \
else \
{ \
for (int32_t i=0; i<num_feat; i++) \
{ \
int32_t j; \
for (j=0; j<num_vec-1; j++) \
fprintf(file, "%" format "%c", matrix[i+j*num_vec], m_delimiter); \
fprintf(file, "%" format "\n", matrix[i+j*num_vec]); \
} \
} \
\
SG_RESET_LOCALE; \
}

Definition at line 313 of file CSVFile.cpp.

#define SET_SPARSE_MATRIX (   format,
  sg_type 
)
Value:
void CCSVFile::set_sparse_matrix( \
const SGSparseVector<sg_type>* matrix, int32_t num_feat, int32_t num_vec) \
{ \
SG_NOTIMPLEMENTED \
}

Definition at line 356 of file CSVFile.cpp.

#define SET_STRING_LIST (   sg_type)
Value:
void CCSVFile::set_string_list( \
const SGString<sg_type>* strings, int32_t num_str) \
{ \
SG_NOTIMPLEMENTED \
}

Definition at line 440 of file CSVFile.cpp.

#define SET_VECTOR (   format,
  sg_type 
)
Value:
void CCSVFile::set_vector(const sg_type* vector, int32_t len) \
{ \
SG_SET_LOCALE_C; \
\
if (!is_data_transposed) \
{ \
for (int32_t i=0; i<len; i++) \
fprintf(file, "%" format "\n", vector[i]); \
} \
else \
{ \
int32_t i; \
for (i=0; i<len-1; i++) \
fprintf(file, "%" format "%c", vector[i], m_delimiter); \
fprintf(file, "%" format "\n", vector[i]); \
} \
\
SG_RESET_LOCALE; \
}

Definition at line 278 of file CSVFile.cpp.


SHOGUN Machine Learning Toolbox - Documentation