00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00033 #ifndef LURUPA_REPORT_H
00034 #define LURUPA_REPORT_H
00035
00036 #include <lurupa/globals.h>
00037 #include <Vector.h>
00038 #include <Matrix.h>
00039 #include <stdarg.h>
00040
00041 #ifndef LU_REPORT_SCOPE
00042 # if defined(_WIN32) || defined(WIN32)
00043 # ifdef LU_REPORT_IMPORT
00044 # define LU_REPORT_SCOPE __declspec(dllimport)
00045 # elif defined DLL_EXPORT
00046 # define LU_REPORT_SCOPE __declspec(dllexport)
00047 # endif
00048 # endif
00049 # ifndef LU_REPORT_SCOPE
00050 # define LU_REPORT_SCOPE
00051 # endif
00052 #endif
00053
00059 class LU_REPORT_SCOPE Report {
00060 public:
00062 Report();
00063
00065 void set_verbosity(short level, bool print_time, bool write_vm);
00066
00068 void set_level(short level);
00070 short get_level() const;
00071
00073 void set_print_time(bool print_time);
00075 bool get_print_time() const;
00076
00078 void set_write_vm(bool write_vm);
00080 bool get_write_vm() const;
00081
00083 void set_csv_style(Csv_style style);
00085 Csv_style get_csv_style() const;
00086
00088 void set_normal(FILE *normal);
00089
00091 void set_warning(FILE *warning);
00092
00094 void set_error(FILE *error);
00095
00096 #ifdef WITH_MATLAB
00097
00098 void set_mex(bool mex, int (*mexPrintf)(const char *,...), void (*mexWarnMsgTxt)(const char *));
00100 bool is_mex();
00101 #endif
00102
00104 void print(short type, const char *format, ...) const;
00105
00107 void write_vector(const char *file, const VECTOR &x, const char *name) const;
00108
00110 void write_matrix(const char *file, const MATRIX &X, const char *name) const;
00111
00112 private:
00113 bool print_time;
00114 bool write_vm;
00115 short level;
00116 Csv_style csv_style;
00117 FILE *normal;
00118 FILE *warning;
00119 FILE *error;
00121 #ifdef WITH_MATLAB
00122 bool mex;
00123 int (*mexPrintf)(const char *, ...);
00124 void (*mexWarnMsgTxt)(const char *);
00125 #endif
00126
00127 };
00128 #endif