Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

vndstat.h

Go to the documentation of this file.
00001 
00002 // FILE vndstat.h
00003 
00004 
00005 #ifndef INCLUDED_VNDSTATS_H
00006 #define INCLUDED_VNDSTATS_H
00007 
00008 #include <assert.h>
00009 #include "vnodecnf.h" 
00010 
00011 
00017 class ERROR
00018 {
00019 
00020 public:
00021   
00023   ERROR() : T(0), E(-1) {;}
00024   
00031   void SetError( double t, double e )  { assert(e>=0); T = t; E = e; }
00032     
00037   double GetError() const { return E; }
00038   
00043   double GetT() const { return T; }
00044   
00045 
00046 private:
00047 
00049   double T;
00050 
00052   double E; 
00053 };
00054 
00055 
00056 
00057 
00065 class SOLVER_STATS
00066 {
00067   
00068 public:
00069   
00071   SOLVER_STATS();
00072   
00074   void Reset();
00075   
00082   void SetRelError( double t, double e );
00083   
00091   void SetAbsError( double t, const double e );
00092   
00098   double GetMaxRelError() const;
00099   
00105   double GetMaxAbsError() const;
00106     
00112   double GetWhereMaxRelError() const;
00113   
00119   double GetWhereMaxAbsError() const;
00120   
00126   double GetRelError() const;
00127     
00133   double GetAbsError() const;
00134   
00140   double GetWhereRelError() const;
00141   
00147   double GetWhereAbsError() const;
00148   
00154   void AddUserTime( double time );
00155   
00157   double GetUserTime()  const;
00158   
00160   unsigned int  GetAcceptedSteps() const;
00161   
00163   unsigned int  GetRejectedSteps() const;
00164 
00166   unsigned int  GetTotalSteps() const;
00167   
00174   void AccRejStep( bool b );
00175 
00176   
00177 private:
00178   
00180   unsigned int NofSteps;
00181   
00183   unsigned int NofRejectedSteps;
00184   
00186   double   CPUTime;
00187   
00189   ERROR MaxRelError, RelError, MaxAbsError, AbsError;
00190   
00191 }; 
00192 
00193 
00195 typedef SOLVER_STATS * PtrSolverStats;
00196 
00197 
00198 inline SOLVER_STATS :: SOLVER_STATS()
00199 {
00200   Reset();
00201 }
00202 
00203 
00204 inline void SOLVER_STATS :: SetRelError( double t, double e ) 
00205 { 
00206   assert( e>=0 );
00207   
00208   RelError.SetError( t,e ) ; 
00209   
00210   if ( e > MaxRelError.GetError() ) 
00211     MaxRelError.SetError( t,e ); 
00212 } 
00213 
00214 
00215 inline double SOLVER_STATS :: GetMaxRelError() const 
00216 { 
00217   return MaxRelError.GetError(); 
00218 }
00219 
00220 
00221 inline double SOLVER_STATS :: GetWhereMaxRelError() const 
00222 { 
00223   return MaxRelError.GetT(); 
00224 }
00225 
00226 
00227 inline double SOLVER_STATS :: GetRelError() const 
00228 { 
00229   return RelError.GetError(); 
00230 }
00231 
00232 
00233 inline double SOLVER_STATS :: GetWhereRelError() const 
00234 { 
00235   return RelError.GetT(); 
00236 }
00237 
00238 
00239 inline void SOLVER_STATS :: SetAbsError( double t, double e ) 
00240 { 
00241   assert( e>=0 );
00242   AbsError.SetError(t,e); 
00243   
00244   if ( e > MaxAbsError.GetError() ) 
00245     MaxAbsError.SetError(t,e); 
00246 } 
00247 
00248 
00249 inline double SOLVER_STATS :: GetMaxAbsError() const 
00250 { 
00251   return MaxAbsError.GetError(); 
00252 }
00253 
00254 
00255 inline double SOLVER_STATS :: GetWhereMaxAbsError() const 
00256 { 
00257   return MaxAbsError.GetT(); 
00258 }
00259 
00260 
00261 inline double SOLVER_STATS :: GetAbsError() const 
00262 { 
00263   return AbsError.GetError(); 
00264 }
00265 
00266 
00267 inline double SOLVER_STATS :: GetWhereAbsError() const 
00268 { 
00269   return AbsError.GetT(); 
00270 }
00271 
00272 
00273 inline void SOLVER_STATS :: AddUserTime ( double time ) 
00274 { 
00275   assert( time>=0 );
00276 
00277   BiasRoundNear();
00278   CPUTime += time; 
00279 }
00280 
00281 
00282 inline double  SOLVER_STATS :: GetUserTime () const 
00283 { 
00284   return CPUTime; 
00285 }
00286 
00287 
00288 inline unsigned int SOLVER_STATS ::  GetRejectedSteps() const 
00289 { 
00290   return NofRejectedSteps; 
00291 };
00292 
00293 
00294 inline unsigned int SOLVER_STATS ::  GetAcceptedSteps() const 
00295 { 
00296   return NofSteps; 
00297 };
00298 
00299 
00300 inline unsigned int SOLVER_STATS ::  GetTotalSteps() const 
00301 { 
00302   return NofSteps+NofRejectedSteps; 
00303 };
00304 
00305 
00306 inline void SOLVER_STATS :: AccRejStep( bool b )
00307 {
00308   if ( b )
00309     NofSteps++;
00310   else
00311     NofRejectedSteps++;
00312 }
00313 
00314 
00315 #endif

Generated at Sun Oct 14 12:45:40 2001 for VNODE by doxygen1.2.0 written by Dimitri van Heesch, © 1997-2000