yat  0.21pre
VectorFunction.h
1 #ifndef _theplu_yat_statistics_vector_function_
2 #define _theplu_yat_statistics_vector_function_
3 
4 // $Id: VectorFunction.h 4207 2022-08-26 04:36:28Z peter $
5 
6 /*
7  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2013 Jari Häkkinen
9  Copyright (C) 2022 Peter Johansson
10 
11  This file is part of the yat library, http://dev.thep.lu.se/yat
12 
13  The yat library is free software; you can redistribute it and/or
14  modify it under the terms of the GNU General Public License as
15  published by the Free Software Foundation; either version 3 of the
16  License, or (at your option) any later version.
17 
18  The yat library is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with yat. If not, see <http://www.gnu.org/licenses/>.
25 */
26 
27 #include <cstddef>
28 #include <vector>
29 
30 namespace theplu {
31 namespace yat {
32 namespace statistics {
33 
38  {
42  virtual ~VectorFunction();
43 
47  virtual double operator()(const std::vector<double>&) const=0;
48  };
49 
50 
54  struct Max : public VectorFunction
55  {
59  double operator()(const std::vector<double>&) const;
60  };
61 
62 
66  struct Median : public VectorFunction
67  {
73  double operator()(const std::vector<double>&) const;
74  };
75 
79  struct Mean : public VectorFunction
80  {
84  double operator()(const std::vector<double>&) const;
85  };
86 
87 
91  struct Min : public VectorFunction
92  {
96  double operator()(const std::vector<double>&) const;
97  };
98 
103  {
104  public:
109  Nth_Element(size_t N);
110 
114  double operator()(const std::vector<double>&) const;
115 
116  private:
117  size_t N_;
118  };
119 
120 }}} // of namespace statistics, yat, and theplu
121 
122 #endif
Definition: VectorFunction.h:102
The Department of Theoretical Physics namespace as we define it.
Larget element.
Definition: VectorFunction.h:54
virtual double operator()(const std::vector< double > &) const =0
abstract interface
double operator()(const std::vector< double > &) const
double operator()(const std::vector< double > &) const
Mean element.
Definition: VectorFunction.h:79
Median element.
Definition: VectorFunction.h:66
double operator()(const std::vector< double > &) const
Smallest element.
Definition: VectorFunction.h:91
double operator()(const std::vector< double > &) const
double operator()(const std::vector< double > &) const
Interface Class for vector functors.
Definition: VectorFunction.h:37

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