yat  0.21pre
averager_traits.h
1 #ifndef _theplu_yat_utility_averager_traits_
2 #define _theplu_yat_utility_averager_traits_
3 
4 // $Id: averager_traits.h 3550 2017-01-03 05:41:02Z peter $
5 
6 /*
7  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2016 Peter Johansson
9 
10  This file is part of the yat library, http://dev.thep.lu.se/yat
11 
12  The yat library is free software; you can redistribute it and/or
13  modify it under the terms of the GNU General Public License as
14  published by the Free Software Foundation; either version 3 of the
15  License, or (at your option) any later version.
16 
17  The yat library is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with yat. If not, see <http://www.gnu.org/licenses/>.
24 */
25 
26 #include "Averager.h"
27 #include "AveragerWeighted.h"
28 #include "AveragerPair.h"
29 #include "AveragerPairWeighted.h"
30 #include "yat/utility/iterator_traits.h"
31 
32 namespace theplu {
33 namespace yat {
34 namespace statistics {
35 
39  template <typename T>
40  struct averager_traits{};
41 
45  template <>
46  struct averager_traits<utility::unweighted_iterator_tag>
47  {
51  typedef Averager type;
56  };
57 
61  template <>
62  struct averager_traits<utility::weighted_iterator_tag>
63  {
72  };
73 
78  template <typename Iterator>
79  struct averager
80  {
87  };
88 
93  template <typename Iterator1, typename Iterator2>
95  {
101  typedef typename
104  >::pair_type type;
105  };
106 
107 }}} // of namespace statistics, yat, and theplu
108 
109 #endif
AveragerPairWeighted pair_type
Definition: averager_traits.h:71
Class to calculate simple (first and second moments) averages.
Definition: Averager.h:46
Class for taking care of mean and covariance of two variables in a weighted manner.
Definition: AveragerPairWeighted.h:56
The Department of Theoretical Physics namespace as we define it.
Class to calulate averages with weights.
Definition: AveragerWeighted.h:66
Class for taking care of mean and covariance of two variables.
Definition: AveragerPair.h:47
Definition: averager_traits.h:94
Definition: averager_traits.h:79
Definition: averager_traits.h:40
averager_traits< typename utility::weighted_if_any2< Iterator1, Iterator2 >::type >::pair_type type
Definition: averager_traits.h:104
detail::unweighted_type_and< w_type1, w_type2 >::type type
return unweighted if both are unweighted
Definition: iterator_traits.h:165
averager_traits< typename utility::weighted_iterator_traits< Iterator >::type >::type type
Definition: averager_traits.h:86

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14