source: trunk/src/AveragerPair.cc @ 197

Last change on this file since 197 was 197, checked in by Jari Häkkinen, 17 years ago

Cleanup interfaces for Averager classes and move stuff into statsitics
namespace.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 800 bytes
Line 
1// $Id: AveragerPair.cc 197 2004-10-27 19:04:22Z jari $
2
3#include "AveragerPair.h"
4
5#include "Averager.h"
6//#include <sys/types.h>
7//#include <ostream>
8//#include "vector.h"
9#include <utility>
10
11namespace theplu {
12namespace statistics{
13 
14
15  AveragerPair::AveragerPair(void)
16    : x_(Averager()), y_(Averager()), xy_(0.0)
17  {
18  }
19
20  AveragerPair::AveragerPair(const double x, const double xx, const double y, 
21                     const double yy, const double xy, const long n)
22    : x_(Averager(x,xx,n)), y_(Averager(y,yy,n)), xy_(xy)
23  {
24  }
25
26  AveragerPair::AveragerPair(const AveragerPair& a)
27    : x_(a.x_averager()), y_(a.y_averager()), xy_(a.sum_xy())
28  {
29  }
30
31  const AveragerPair& AveragerPair::operator+=(const AveragerPair& a)
32  {
33    x_+=a.x_averager();
34    y_+=a.y_averager();
35    xy_+=a.sum_xy();
36    return *this;
37  }
38
39}} // of namespace statistics and namespace theplu
Note: See TracBrowser for help on using the repository browser.