yat  0.13.2pre
Gauss.h
1 #ifndef _theplu_yat_normalizer_gauss_
2 #define _theplu_yat_normalizer_gauss_
3 
4 // $Id: Gauss.h 3330 2014-10-14 08:03:25Z peter $
5 
6 /*
7  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2009, 2010, 2014 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 "Spearman.h"
27 #include "yat/utility/concept_check.h"
28 #include "yat/utility/iterator_traits.h"
29 
30 #include <boost/concept_check.hpp>
31 
32 #include <gsl/gsl_cdf.h>
33 
34 #include <iterator>
35 
36 namespace theplu {
37 namespace yat {
38 namespace normalizer {
39 
52  class Gauss
53  {
54  public:
71  template<typename RandomAccessIter1, typename RandomAccessIter2>
72  void operator()(RandomAccessIter1 first, RandomAccessIter1 last,
73  RandomAccessIter2 result) const
74  {
75  Spearman spearman;
76  spearman(first, last, result);
77  RandomAccessIter2 end = result + std::distance(first, last);
79  while (result != end) {
80  trait.data(result) = gsl_cdf_ugaussian_Pinv(trait.data(result));
81  ++result;
82  }
83  }
84 
85 
86  private:
87  };
88 
89 }}} // end of namespace normalizer, yat and thep
90 #endif
data_reference data(Iter iter) const
Definition: iterator_traits.h:440
Definition: iterator_traits.h:412
Replace elements with normalized rank.
Definition: Spearman.h:56
Gaussian Normalizer.
Definition: Gauss.h:52
void operator()(RandomAccessIter1 first, RandomAccessIter1 last, RandomAccessIter2 result) const
Definition: Gauss.h:72

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