source:
trunk/src/WeightedAverager.cc
@
95
Last change on this file since 95 was 95, checked in by , 19 years ago | |
---|---|
|
|
File size: 613 bytes |
Line | |
---|---|
1 | // $Id: WeightedAverager.cc 95 2004-06-09 16:01:43Z peter $ |
2 | |
3 | #include <sys/types.h> |
4 | |
5 | #include <ostream> |
6 | |
7 | #include "Averager.h" |
8 | #include "WeightedAverager.h" |
9 | |
10 | namespace theplu { |
11 | namespace cpptools{ |
12 | |
13 | |
14 | WeightedAverager::WeightedAverager(void) |
15 | : w_(Averager()), wx_(Averager()), wwx_(0) |
16 | { |
17 | } |
18 | |
19 | WeightedAverager::WeightedAverager(const double d, const double w) |
20 | : w_(Averager(w,w*w,1)), wx_(Averager(w*d,w*w*d*d,1)), wwx_(w*w*d) |
21 | { |
22 | } |
23 | |
24 | WeightedAverager::WeightedAverager(const WeightedAverager& a) |
25 | : w_(Averager(a.sum_w(), a.sum_ww(),1)), |
26 | wx_(Averager(a.sum_wx(),a.sum_wwxx(),1)), wwx_(a.sum_wwx()) |
27 | { |
28 | } |
29 | |
30 | |
31 | }} // of namespace cpptools and namespace theplu |
Note: See TracBrowser
for help on using the repository browser.