yat  0.11.3pre
Averager4.h
1 #ifndef _theplu_yat_statistics_averager4
2 #define _theplu_yat_statistics_averager4
3 
4 // $Id: Averager4.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 Averager4 : public averager_base4<Averager4>
37  {
38  public:
42  Averager4(void);
43 
47  //const Averager& averager(void) const;
48 
96  template<class Derived>
97  const Averager4& operator+=(const averager_base4<Derived>& rhs);
98  private:
99  friend class averager_base<Averager4>;
100  // static virtual function in averager_base
101  void add_impl(double, long int n);
102  void rescale_impl(double);
103 
104  // using compiler generated copy and assignment
105  // Averager4(const Averager4&)
106  // Averager4& operator=(const Averager4& rhs);
107  };
108 
109  template<class Derived>
111  {
112  this->add4(rhs.mean(), rhs.sum_xx_centered(),
113  rhs.sum_x3_centered(), rhs.sum_x4_centered(), rhs.n());
114  return *this;
115  }
116 
117 }}} // of namespace statistics, yat, and theplu
118 #endif

Generated on Sat May 24 2014 03:33:05 for yat by  doxygen 1.8.2