MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Stats.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2003-2011 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 #ifndef _STATS_H
10 #define _STATS_H
11 
12 class Stats
13 {
14  public:
15  Stats();
16 
18  // Field assignment stuff.
20 
21  double getMean() const;
22  double getSdev() const;
23  double getSum() const;
24  unsigned int getNum() const;
25 
26  double getWmean() const;
27  double getWsdev() const;
28  double getWsum() const;
29  unsigned int getWnum() const;
30 
31  void setWindowLength( unsigned int len );
32  unsigned int getWindowLength() const;
33 
35  // Dest Func
37  void input( double v );
38 
39  void process( const Eref& e, ProcPtr p );
40  void reinit( const Eref& e, ProcPtr p );
41 
43  virtual void vProcess( const Eref& e, ProcPtr p );
44  virtual void vReinit( const Eref& e, ProcPtr p );
45 
47  // other func
49  void doWindowCalculation() const;
51 
53  static const Cinfo* initCinfo();
54  private:
55  double mean_;
56  double sdev_;
57  double sum_;
58  unsigned int num_;
59  double wmean_;
60  double wsdev_;
61  double wsum_;
62  unsigned int wnum_;
63  double sumsq_;
64  double lastt_;
65  vector< double > samples_;
67 };
68 
69 #endif // _STATS_H
vector< double > samples_
Definition: Stats.h:65
unsigned int num_
Definition: Stats.h:58
bool isWindowDirty_
Definition: Stats.h:66
double getSdev() const
Definition: Stats.cpp:204
unsigned int getWindowLength() const
Definition: Stats.cpp:255
double wsdev_
Definition: Stats.h:60
double getWmean() const
Definition: Stats.cpp:221
void setWindowLength(unsigned int len)
Definition: Stats.cpp:245
double lastt_
Definition: Stats.h:64
double mean_
Definition: Stats.h:55
Stats()
Definition: Stats.cpp:134
void process(const Eref &e, ProcPtr p)
Definition: Stats.cpp:147
double getSum() const
Definition: Stats.cpp:211
double sdev_
Definition: Stats.h:56
double sumsq_
Definition: Stats.h:63
double getWsdev() const
Definition: Stats.cpp:227
static const Cinfo * initCinfo()
Definition: Stats.cpp:21
double wsum_
Definition: Stats.h:61
double getMean() const
Definition: Stats.cpp:197
double sum_
Definition: Stats.h:57
double getWsum() const
Definition: Stats.cpp:233
unsigned int getNum() const
Definition: Stats.cpp:216
virtual void vReinit(const Eref &e, ProcPtr p)
Definition: Stats.cpp:166
unsigned int getWnum() const
Definition: Stats.cpp:239
unsigned int wnum_
Definition: Stats.h:62
virtual void vProcess(const Eref &e, ProcPtr p)
Virtual func for handling process calls for derived classes.
Definition: Stats.cpp:152
Definition: Eref.h:26
void reinit(const Eref &e, ProcPtr p)
Definition: Stats.cpp:161
Definition: Stats.h:12
void input(double v)
Definition: Stats.cpp:183
void innerWindowCalculation()
Definition: Stats.cpp:268
double wmean_
Definition: Stats.h:59
Definition: Cinfo.h:18
void doWindowCalculation() const
Definition: Stats.cpp:262