ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/System8/s8/Stat/interface/Measurement.h
Revision: 1.1
Committed: Fri May 6 14:36:22 2011 UTC (14 years ago) by samvel
Content type: text/plain
Branch: MAIN
CVS Tags: V00-00-04, V00-00-03, V00-00-02-04, V00-00-02-03, V00-00-02-02, V00-00-02-01, V00-00-02, melo-old, HEAD
Log Message:
Import Stat

File Contents

# User Rev Content
1 samvel 1.1 /**
2     * Measurement
3     * s8
4     *
5     * Created by Samvel Khalatian on Dec 20, 2010
6     * Copyright 2010, All rights reserved
7     */
8    
9     #ifndef S8_MEASUREMENT
10     #define S8_MEASUREMENT
11    
12     #include <iosfwd>
13    
14     namespace s8
15     {
16     class Measurement
17     {
18     public:
19     Measurement() throw();
20    
21     // Measurement(central_value, variance)
22     //
23     explicit Measurement(const double &, const double &) throw();
24    
25     double value() const;
26     double variance() const;
27    
28     void setValue(const double &);
29     void setVariance(const double &);
30    
31     private:
32     double _value;
33     double _variance;
34     };
35    
36     std::ostream &operator <<(std::ostream &, const Measurement &);
37    
38     // Define simple logic
39     //
40     // Note: Measurements are assumed to be indenepdent in the error
41     // propagation
42     //
43     Measurement operator +(const Measurement &, const Measurement &);
44     Measurement operator -(const Measurement &, const Measurement &);
45     Measurement operator *(const Measurement &, const Measurement &);
46    
47     // Regular error propagation
48     //
49     Measurement operator /(const Measurement &, const Measurement &);
50    
51     // Binomial error propagation
52     //
53     Measurement operator %(const Measurement &, const Measurement &);
54    
55     // Shortcuts for the above operators
56     //
57     void operator+=(Measurement &, const Measurement &);
58     void operator-=(Measurement &, const Measurement &);
59     void operator*=(Measurement &, const Measurement &);
60    
61     // Regular error propagation
62     //
63     void operator/=(Measurement &, const Measurement &);
64    
65     // Binomial error propagation
66     //
67     void operator%=(Measurement &, const Measurement &);
68     }
69    
70     #endif