Go to the source code of this file.
|
| #define | GET_VECTOR(fname, conv, sg_type) |
| |
| #define | GET_FLOAT_VECTOR(sg_type) |
| |
| #define | GET_VECTOR_AND_LABEL(fname, conv, sg_type) |
| |
| #define | GET_FLOAT_VECTOR_AND_LABEL(sg_type) |
| |
| #define | GET_STRING(fname, conv, sg_type) |
| |
| #define | GET_STRING_AND_LABEL(fname, conv, sg_type) |
| |
| #define | GET_SPARSE_VECTOR(fname, conv, sg_type) |
| |
| #define | GET_SPARSE_VECTOR_AND_LABEL(fname, conv, sg_type) |
| |
| #define GET_FLOAT_VECTOR |
( |
|
sg_type | ) |
|
Value:void CStreamingAsciiFile::get_vector(sg_type*& vector, int32_t& len) \
{ \
char *line=NULL; \
int32_t num_chars = buf->read_line(line); \
int32_t old_len = len; \
\
if (num_chars == 0) \
{ \
len = -1; \
return; \
} \
\
substring example_string = {line, line + num_chars}; \
\
CAsciiFile::tokenize(' ', example_string, words); \
\
len = words.index(); \
substring* feature_start = &words[0]; \
\
if (len > old_len) \
\
int32_t j=0; \
{ \
} \
}
float32_t float_of_substring(substring s)
struct Substring, specified by start position and end position.
#define SG_REALLOC(type, ptr, len)
Definition at line 116 of file StreamingAsciiFile.cpp.
| #define GET_FLOAT_VECTOR_AND_LABEL |
( |
|
sg_type | ) |
|
Value:void CStreamingAsciiFile::get_vector_and_label(sg_type*& vector, int32_t& len,
float64_t& label) \
{ \
char *line=NULL; \
int32_t num_chars = buf->read_line(line); \
int32_t old_len = len; \
\
if (num_chars == 0) \
{ \
len = -1; \
return; \
} \
\
substring example_string = {line, line + num_chars}; \
\
CAsciiFile::tokenize(' ', example_string, words); \
\
\
len = words.index() - 1; \
substring* feature_start = &words[1]; \
\
if (len > old_len) \
\
int32_t j=0; \
{ \
} \
}
float32_t float_of_substring(substring s)
struct Substring, specified by start position and end position.
#define SG_REALLOC(type, ptr, len)
Definition at line 235 of file StreamingAsciiFile.cpp.
| #define GET_SPARSE_VECTOR |
( |
|
fname, |
|
|
|
conv, |
|
|
|
sg_type |
|
) |
| |
| #define GET_SPARSE_VECTOR_AND_LABEL |
( |
|
fname, |
|
|
|
conv, |
|
|
|
sg_type |
|
) |
| |
| #define GET_STRING |
( |
|
fname, |
|
|
|
conv, |
|
|
|
sg_type |
|
) |
| |
Value:void CStreamingAsciiFile::get_string(sg_type*& vector, int32_t& len) \
{ \
char* buffer = NULL; \
ssize_t bytes_read; \
\
bytes_read = buf->read_line(buffer); \
\
if (bytes_read<=1) \
{ \
vector=NULL; \
len=-1; \
return; \
SG_DEBUG(
"Line read from the file:\n%s\n", buffer); \
\
if (buffer[bytes_read-1]=='\n') \
{ \
len=bytes_read-1; \
buffer[bytes_read-1]='\0'; \
} \
else \
len=bytes_read; \
vector=(sg_type *) buffer; \
}
Definition at line 273 of file StreamingAsciiFile.cpp.
| #define GET_STRING_AND_LABEL |
( |
|
fname, |
|
|
|
conv, |
|
|
|
sg_type |
|
) |
| |
| #define GET_VECTOR |
( |
|
fname, |
|
|
|
conv, |
|
|
|
sg_type |
|
) |
| |
| #define GET_VECTOR_AND_LABEL |
( |
|
fname, |
|
|
|
conv, |
|
|
|
sg_type |
|
) |
| |