yat
0.8.3pre
|
00001 #ifndef _theplu_yat_statistics_vector_function_ 00002 #define _theplu_yat_statistics_vector_function_ 00003 00004 // $Id: VectorFunction.h 2119 2009-12-12 23:11:43Z peter $ 00005 00006 /* 00007 Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson 00008 00009 This file is part of the yat library, http://dev.thep.lu.se/yat 00010 00011 The yat library is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU General Public License as 00013 published by the Free Software Foundation; either version 3 of the 00014 License, or (at your option) any later version. 00015 00016 The yat library is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with yat. If not, see <http://www.gnu.org/licenses/>. 00023 */ 00024 00025 #include <vector> 00026 00027 namespace theplu { 00028 namespace yat { 00029 namespace statistics { 00030 00034 struct VectorFunction 00035 { 00039 virtual ~VectorFunction(); 00040 00044 virtual double operator()(const std::vector<double>&) const=0; 00045 }; 00046 00047 00051 struct Max : public VectorFunction 00052 { 00056 double operator()(const std::vector<double>&) const; 00057 }; 00058 00059 00063 struct Median : public VectorFunction 00064 { 00070 double operator()(const std::vector<double>&) const; 00071 }; 00072 00076 struct Mean : public VectorFunction 00077 { 00081 double operator()(const std::vector<double>&) const; 00082 }; 00083 00084 00088 struct Min : public VectorFunction 00089 { 00093 double operator()(const std::vector<double>&) const; 00094 }; 00095 00099 class Nth_Element : public VectorFunction 00100 { 00101 public: 00106 Nth_Element(size_t N); 00107 00111 double operator()(const std::vector<double>&) const; 00112 00113 private: 00114 size_t N_; 00115 }; 00116 00117 }}} // of namespace statistics, yat, and theplu 00118 00119 #endif