yat  0.10.4pre
Averager3.h
1 #ifndef _theplu_yat_statistics_averager3
2 #define _theplu_yat_statistics_averager3
3 
4 // $Id: Averager3.h 2809 2012-08-06 13:44:47Z peter $
5 
6 /*
7  Copyright (C) 2012 Peter Johansson
8 
9  This file is part of the yat library, http://dev.thep.lu.se/yat
10 
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15 
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #include "averager_base.h"
26 
27 namespace theplu {
28 namespace yat {
29 namespace statistics {
30 
36  class Averager3 : public averager_base3<Averager3>
37  {
38  public:
42  Averager3(void);
43 
47  template<class Derived>
48  const Averager3& operator+=(const averager_base3<Derived>& rhs);
49  private:
50  friend class averager_base<Averager3>;
51  // static virtual function in averager_base
52  void add_impl(double, long int n);
53  void rescale_impl(double);
54 
55  // using compiler generated copy and assignment
56  // Averager4(const Averager4&)
57  // Averager4& operator=(const Averager4& rhs);
58  };
59 
60  template<class Derived>
62  {
63  this->add3(rhs.mean(), rhs.sum_xx_centered(), rhs.sum_x3_centered(),
64  rhs.n());
65  return *this;
66  }
67 
68 }}} // of namespace statistics, yat, and theplu
69 #endif

Generated on Mon Nov 11 2013 09:41:44 for yat by  doxygen 1.8.1