This is the datatype for a filewriter. It extends the basic gnn_output : Writing sets of vectors. structure to include the additional pointer to the output samples matrix, and a vector view.
A filewriter, when created, opens the given file in ASCII mode. Alternativelly, you can provide an already opened file pointer. After that, it writes the given samples one after another (line per line) to the opened output stream.
By default, vectors are written line-wise, with the format "g\t" to seperate the elements (of the printed vector). A new format string can be given, of course.
Additionally, a prefix and a postfix format string can be used. The are pre- and post-concatenated to the string containing the vector's elements.
As an example, the following output will be produced without pre- and postfix strings:
12.345 3.45 8 0.1247 3.387 0.001 78.56 5 89.23 12.2356 0.147 0.235
Using the prefix "Pattern d : [" and postfix "]", the same samples will be printed as:
Pattern 0 : [12.345 3.45 8 ] Pattern 1 : [0.1247 3.387 0.001 ] Pattern 2 : [78.56 5 89.23 ] Pattern 3 : [12.2356 0.147 0.235 ]
Please note that the prefix contains a "d" substring. This is the one and only allowed format command for the prefix, which will be replaced by the number of the output sample to be written.
Typedefs | |
| typedef _gnn_filewriter | gnn_filewriter |
| The datatype for a filewriter. | |
Functions | |
| int | gnn_filewriter_put (gnn_output *set, size_t k, const gsl_vector *v) |
| The "put" function. | |
| void | gnn_filewriter_destroy (gnn_output *set) |
| The "destroy" function. | |
| gnn_output * | gnn_filewriter_new (FILE *fp) |
| Builds a new filewriter device. | |
| gnn_output * | gnn_filewriter_with_file_new (const char *filename) |
| Builds a new filewriter device with a given filename. | |
| int | gnn_filewriter_set_format (gnn_output *set, const char *fmt) |
| Sets a new print format. | |
| const char * | gnn_filewriter_get_format (gnn_output *set) |
| Gets the print format. | |
| int | gnn_filewriter_set_prefix (gnn_output *set, const char *prefix) |
| Sets a new printing prefix. | |
| const char * | gnn_filewriter_get_prefix (gnn_output *set) |
| Gets the prefix format string. | |
| int | gnn_filewriter_set_postfix (gnn_output *set, const char *postfix) |
| Sets a new printing postfix. | |
| const char * | gnn_filewriter_get_postfix (gnn_output *set) |
| Gets the postfix format string. | |
| int | gnn_filewriter_owns_file (gnn_output *set) |
| Check if it owns the file. | |
|
|
Definition at line 98 of file gnn_filewriter.c. |
|
|
Definition at line 170 of file gnn_filewriter.c. |
|
|
This function returns a pointer to the currently used vector elements print format.
Definition at line 339 of file gnn_filewriter.c. |
|
|
This function returns a pointer to the currently used postfix string.
Definition at line 443 of file gnn_filewriter.c. |
|
|
This function returns a pointer to the currently used prefix string.
Definition at line 391 of file gnn_filewriter.c. |
|
|
This function creates a new gnn_filewriter : File Output Device. device with the given opened file pointer. When destroyed, the stream won't be closed.
Definition at line 205 of file gnn_filewriter.c. |
|
|
This function returns 1 if the gnn_filewriter : File Output Device. owns the file.
Definition at line 465 of file gnn_filewriter.c. |
|
||||||||||||||||
|
Definition at line 132 of file gnn_filewriter.c. |
|
||||||||||||
|
This function sets a new print format for the vector elements of the samples. The default is
Definition at line 308 of file gnn_filewriter.c. |
|
||||||||||||
|
This function sets a new printing postfix, which will be postpended to every printed output vector. This string can contain at most one integer format specifier, like
Definition at line 416 of file gnn_filewriter.c. |
|
||||||||||||
|
This function sets a new printing prefix, which will be prepended to every printed output vector. This string can contain at most one integer format specifier, like
Definition at line 364 of file gnn_filewriter.c. |
|
|
This function creates a new gnn_filewriter : File Output Device. device. It opens the file filename for printing. The gnn_filewriter : File Output Device. is the owner of the file and closes it when destroyed.
Definition at line 262 of file gnn_filewriter.c. |
1.2.18