]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Common/IncrementalMeanAndVariance.h
...
[FrontAlgorithms.git] / lib / fpa / Common / IncrementalMeanAndVariance.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Common__IncrementalMeanAndVariance__h__
6 #define __fpa__Common__IncrementalMeanAndVariance__h__
7
8 #include <fpa/fpa_export.h>
9
10 namespace fpa
11 {
12   namespace Common
13   {
14     /**
15      */
16     class FPA_EXPORT IncrementalMeanAndVariance
17     {
18     public:
19       typedef IncrementalMeanAndVariance Self;
20
21     public:
22       IncrementalMeanAndVariance( );
23       virtual ~IncrementalMeanAndVariance( );
24
25       double GetMean( ) const;
26       double GetVariance( ) const;
27       double GetDeviation( ) const;
28       unsigned long GetNumberOfSamples( ) const;
29
30       void Clear( );
31       void AddValue( double v );
32
33     protected:
34       double m_M;
35       double m_V;
36       double m_N;
37     };
38
39   } // ecapseman
40
41 } // ecapseman
42
43 #endif // __fpa__Common__IncrementalMeanAndVariance__h__
44 // eof - $RCSfile$