FANN Error Handling |
FANN Error HandlingErrors from the fann library are usually reported on stderr. It is however possible to redirect these error messages to a file, or completely ignore them by the fann_set_error_log function. It is also possible to inspect the last error message by using the fann_get_errno and fann_get_errstr functions. Summary
fann_errno_enumUsed to define error events on struct fann and struct fann_train_data. See alsofann_get_errno, fann_reset_errno, fann_get_errstr
fann_set_error_log
Change where errors are logged to. Both struct fann and <struct fann_data> can be casted to struct fann_error, so this function can be used to set either of these. If log_file is NULL, no errors will be printed. If errdata is NULL, the default log will be set. The default log is the log used when creating struct fann and <struct fann_data>. This default log will also be the default for all new structs that are created. The default behavior is to log them to stderr. See alsoThis function appears in FANN >= 1.1.0. fann_get_errno
Returns the last error number. See alsofann_errno_enum, fann_reset_errno This function appears in FANN >= 1.1.0. fann_get_errstr
Returns the last errstr. This function calls fann_reset_errno and fann_reset_errstr This function appears in FANN >= 1.1.0. |
Change where errors are logged to.
FANN_EXTERNAL void FANN_API fann_set_error_log( struct fann_error * errdat, FILE * log_file )
Returns the last error number.
FANN_EXTERNAL enum fann_errno_enum FANN_API fann_get_errno( struct fann_error * errdat )
Resets the last error number.
FANN_EXTERNAL void FANN_API fann_reset_errno( struct fann_error * errdat )
Resets the last error string.
FANN_EXTERNAL void FANN_API fann_reset_errstr( struct fann_error * errdat )
Returns the last errstr.
FANN_EXTERNAL char *FANN_API fann_get_errstr( struct fann_error * errdat )
Prints the last error to stderr.
FANN_EXTERNAL void FANN_API fann_print_error( struct fann_error * errdat )