SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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; \
\
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 105 of file UAIFile.cpp.

#define SET_VECTOR (   format,
  sg_type 
)
Value:
void CUAIFile::set_vector(const sg_type* vector, int32_t len) \
{ \
SG_SET_LOCALE_C; \
\
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 144 of file UAIFile.cpp.


SHOGUN Machine Learning Toolbox - Documentation