yat  0.14.5pre
Gauss.h
1 #ifndef _theplu_yat_normalizer_gauss_
2 #define _theplu_yat_normalizer_gauss_
3 
4 // $Id: Gauss.h 3550 2017-01-03 05:41:02Z peter $
5 
6 /*
7  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2009, 2010, 2014, 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 "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:
65  template<typename RandomAccessIter1, typename RandomAccessIter2>
66  void operator()(RandomAccessIter1 first, RandomAccessIter1 last,
67  RandomAccessIter2 result) const
68  {
69  Spearman spearman;
70  spearman(first, last, result);
71  RandomAccessIter2 end = result + std::distance(first, last);
73  while (result != end) {
74  trait.data(result) = gsl_cdf_ugaussian_Pinv(trait.data(result));
75  ++result;
76  }
77  }
78 
79 
80  private:
81  };
82 
83 }}} // end of namespace normalizer, yat and thep
84 #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:57
Gaussian Normalizer.
Definition: Gauss.h:52
void operator()(RandomAccessIter1 first, RandomAccessIter1 last, RandomAccessIter2 result) const
Definition: Gauss.h:66

Generated on Tue Sep 26 2017 02:33:29 for yat by  doxygen 1.8.5