source: trunk/lib/statistics/AveragerPair.cc @ 490

Last change on this file since 490 was 490, checked in by Peter, 16 years ago

added tests for AveragerPairWeighted?, corrected docs, and added an
add(vector) for AvergaerPair?

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 557 bytes
Line 
1// $Id: AveragerPair.cc 490 2006-01-04 20:32:05Z peter $
2
3#include <c++_tools/statistics/AveragerPair.h>
4#include <c++_tools/statistics/Averager.h>
5
6#include <cassert>
7#include <utility>
8
9namespace theplu {
10namespace statistics{
11 
12
13  const AveragerPair& AveragerPair::operator+=(const AveragerPair& a)
14  {
15    x_+=a.x_averager();
16    y_+=a.y_averager();
17    xy_+=a.sum_xy();
18    return *this;
19  }
20 
21  void AveragerPair::add(const gslapi::vector& x, const gslapi::vector& y)
22  {
23    assert(x.size()==y.size());
24    for (size_t i=0; i<x.size(); i++) 
25      add(x(i),y(i));
26  }
27
28}} // of namespace statistics and namespace theplu
Note: See TracBrowser for help on using the repository browser.