yat  0.14.5pre
VectorFunction.h
1 #ifndef _theplu_yat_statistics_vector_function_
2 #define _theplu_yat_statistics_vector_function_
3 
4 // $Id: VectorFunction.h 2986 2013-02-18 08:07:44Z peter $
5 
6 /*
7  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2013 Jari Häkkinen
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 <cstddef>
27 #include <vector>
28 
29 namespace theplu {
30 namespace yat {
31 namespace statistics {
32 
37  {
41  virtual ~VectorFunction();
42 
46  virtual double operator()(const std::vector<double>&) const=0;
47  };
48 
49 
53  struct Max : public VectorFunction
54  {
58  double operator()(const std::vector<double>&) const;
59  };
60 
61 
65  struct Median : public VectorFunction
66  {
72  double operator()(const std::vector<double>&) const;
73  };
74 
78  struct Mean : public VectorFunction
79  {
83  double operator()(const std::vector<double>&) const;
84  };
85 
86 
90  struct Min : public VectorFunction
91  {
95  double operator()(const std::vector<double>&) const;
96  };
97 
102  {
103  public:
108  Nth_Element(size_t N);
109 
113  double operator()(const std::vector<double>&) const;
114 
115  private:
116  size_t N_;
117  };
118 
119 }}} // of namespace statistics, yat, and theplu
120 
121 #endif
double operator()(const std::vector< double > &) const
Definition: VectorFunction.h:101
Larget element.
Definition: VectorFunction.h:53
virtual double operator()(const std::vector< double > &) const =0
abstract interface
double operator()(const std::vector< double > &) const
Mean element.
Definition: VectorFunction.h:78
double operator()(const std::vector< double > &) const
Median element.
Definition: VectorFunction.h:65
double operator()(const std::vector< double > &) const
double operator()(const std::vector< double > &) const
Smallest element.
Definition: VectorFunction.h:90
Interface Class for vector functors.
Definition: VectorFunction.h:36

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