yat  0.13.2pre
averager_traits.h
1 #ifndef _theplu_yat_utility_averager_traits_
2 #define _theplu_yat_utility_averager_traits_
3 
4 // $Id: averager_traits.h 2119 2009-12-12 23:11:43Z peter $
5 
6 /*
7  Copyright (C) 2008 Jari Häkkinen, 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.h"
26 #include "AveragerWeighted.h"
27 #include "AveragerPair.h"
28 #include "AveragerPairWeighted.h"
29 #include "yat/utility/iterator_traits.h"
30 
31 namespace theplu {
32 namespace yat {
33 namespace statistics {
34 
38  template <typename T>
39  struct averager_traits{};
40 
44  template <>
45  struct averager_traits<utility::unweighted_iterator_tag>
46  {
50  typedef Averager type;
55  };
56 
60  template <>
61  struct averager_traits<utility::weighted_iterator_tag>
62  {
71  };
72 
77  template <typename Iterator>
78  struct averager
79  {
86  };
87 
92  template <typename Iterator1, typename Iterator2>
93  struct averager_pair
94  {
100  typedef typename
103  >::pair_type type;
104  };
105 
106 }}} // of namespace statistics, yat, and theplu
107 
108 #endif
AveragerPairWeighted pair_type
Definition: averager_traits.h:70
Class to calculate simple (first and second moments) averages.
Definition: Averager.h:45
Class for taking care of mean and covariance of two variables in a weighted manner.
Definition: AveragerPairWeighted.h:56
Class to calulate averages with weights.
Definition: AveragerWeighted.h:65
Class for taking care of mean and covariance of two variables.
Definition: AveragerPair.h:46
Definition: averager_traits.h:93
Definition: averager_traits.h:78
Definition: averager_traits.h:39
averager_traits< typename utility::weighted_if_any2< Iterator1, Iterator2 >::type >::pair_type type
Definition: averager_traits.h:103
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:85

Generated on Wed Jan 4 2017 02:23:07 for yat by  doxygen 1.8.5