source: trunk/c++_tools/statistics/Averager.cc @ 620

Last change on this file since 620 was 620, checked in by Markus Ringnér, 16 years ago

Fixed problems with Averager that sometimes appeared as failures in averager_test when optimization is turned on

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 493 bytes
Line 
1// $Id: Averager.cc 620 2006-09-04 15:16:57Z markus $
2
3#include <c++_tools/statistics/Averager.h>
4
5namespace theplu {
6namespace statistics{
7 
8  Averager::Averager(void)
9    : n_(0), x_(0), xx_(0) 
10  {
11  }
12
13  Averager::Averager(double x, double xx, u_long n)
14    : n_(n), x_(x), xx_(xx) 
15  {
16  }
17 
18  Averager::Averager(const Averager& a)
19    : n_(a.n_), x_(a.x_), xx_(a.xx_)
20  {
21  }
22 
23  const Averager& Averager::operator+=(const Averager& a)
24  {
25    n_+=a.n_;
26    x_+=a.x_;
27    xx_+=a.xx_;
28    return *this;
29  }
30
31
32}} // of namespace statistics and namespace theplu
Note: See TracBrowser for help on using the repository browser.