Report.h

Go to the documentation of this file.
00001 /*
00002  * Lurupa, a library for verified linear programming.
00003  * Copyright (C) 2006 by Christian Keil
00004  *
00005  * This file is part of Lurupa.
00006  *
00007  * Lurupa is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
00020  * USA
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 }; /* class Report */
00128 #endif /* LURUPA_REPORT_H */

Generated on Thu Jun 26 18:08:52 2008 for Lurupa by  doxygen 1.5.6