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

Go to the source code of this file.

Macros

#define GET_VECTOR(read_func, sg_type)
 
#define SET_VECTOR(format, sg_type)
 

Macro Definition Documentation

#define GET_VECTOR (   read_func,
  sg_type 
)
Value:
void CUAIFile::get_vector(sg_type*& vector, int32_t& len) \
{ \
if (!m_line_reader->has_next()) \
return; \
\
SGVector<char> line; \
int32_t num_elements = 0; \
\
line = m_line_reader->read_line(); \
m_tokenizer->set_text(line); \
while (m_tokenizer->has_next()) \
{ \
int32_t temp_start; \
m_tokenizer->next_token_idx(temp_start); \
num_elements++; \
} \
\
vector = SG_MALLOC(sg_type, num_elements); \
m_parser->set_text(line); \
for (int32_t i=0; i<num_elements; i++) \
vector[i] = m_parser->read_func(); \
len = num_elements; \
}

Definition at line 107 of file UAIFile.cpp.

#define SET_VECTOR (   format,
  sg_type 
)
Value:
void CUAIFile::set_vector(const sg_type* vector, int32_t len) \
{ \
\
int32_t i; \
for (i=0; i<len-1; i++) \
fprintf(file, "%" format "%c", vector[i], m_delimiter); \
fprintf(file, "%" format "\n", vector[i]); \
\
}
#define SG_RESET_LOCALE
Definition: SGIO.h:86
#define SG_SET_LOCALE_C
Definition: SGIO.h:85

Definition at line 146 of file UAIFile.cpp.


SHOGUN Machine Learning Toolbox - Documentation