Anasazi Version of the Day
Tsqr_TimeStats.hpp
00001 #ifndef __TSQR_TimeStats_hpp
00002 #define __TSQR_TimeStats_hpp
00003 
00004 // #include <cstddef> // size_t
00005 #include <ostream>
00006 #include <stdexcept>
00007 
00010 
00011 namespace TSQR {
00012 
00013   // Forward declaration
00014   template< class Scalar >
00015   class MessengerBase;
00016 
00023   class TimeStats {
00024   public:
00025     TimeStats();
00026     ~TimeStats() {}
00027 
00030     void init ();
00031 
00034     void update (const double curTime);
00035 
00048     void
00049     print (std::ostream& out, 
00050      const bool humanReadable,
00051      const std::string& label,
00052      const std::string& labelLabel,
00053      const bool printHeaders) const;
00054 
00057     double min() const { return min_; }
00058 
00061     double max() const { return max_; }
00062 
00065     double mean() const { return mean_; }
00066 
00069     double total() const { return total_; }
00070 
00073     int count() const { return count_; }
00074 
00077     static TimeStats
00078     globalTimeStats (MessengerBase< double >* const comm,
00079          const TimeStats& localStats);
00080 
00081   private:
00082     double min_, max_, mean_, total_;
00083     int count_;
00084   };
00085 
00086   
00087 
00088 } // namespace TSQR
00089 
00090 #endif // __TSQR_TimeStats_hpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends