Ignore:
Timestamp:
Dec 18, 2006, 1:47:44 AM (15 years ago)
Author:
Jari Häkkinen
Message:

Addresses #65 and #170.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/AveragerPair.cc

    r683 r703  
    3131namespace yat {
    3232namespace statistics {
    33  
     33
     34  AveragerPair::AveragerPair(void)
     35    : x_(Averager()), y_(Averager()), xy_(0.0)
     36  {
     37  }
     38
     39  AveragerPair::AveragerPair(const AveragerPair& a)
     40    : x_(a.x_averager()), y_(a.y_averager()), xy_(a.sum_xy())
     41  {
     42  }
     43
     44  void AveragerPair::add(const double x, const double y, const unsigned long n)
     45  {
     46    x_.add(x,n); y_.add(y,n); xy_ += n*x*y;
     47  }
     48
     49  void AveragerPair::reset(void)
     50  {
     51    x_.reset(); y_.reset(); xy_=0.0;
     52  }
     53
     54  const AveragerPair& AveragerPair::operator=(const AveragerPair& a)
     55  {
     56    x_=a.x_; y_=a.y_; xy_=a.xy_;
     57    return *this;
     58  }
     59
    3460  const AveragerPair& AveragerPair::operator+=(const AveragerPair& a)
    3561  {
Note: See TracChangeset for help on using the changeset viewer.