yat
0.8.3pre
|
00001 #ifndef _theplu_yat_regression_local_ 00002 #define _theplu_yat_regression_local_ 00003 00004 // $Id: Local.h 2564 2011-09-25 20:03:41Z peter $ 00005 00006 /* 00007 Copyright (C) 2004 Peter Johansson 00008 Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson 00009 Copyright (C) 2009, 2010, 2011 Peter Johansson 00010 00011 This file is part of the yat library, http://dev.thep.lu.se/yat 00012 00013 The yat library is free software; you can redistribute it and/or 00014 modify it under the terms of the GNU General Public License as 00015 published by the Free Software Foundation; either version 3 of the 00016 License, or (at your option) any later version. 00017 00018 The yat library is distributed in the hope that it will be useful, 00019 but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00021 General Public License for more details. 00022 00023 You should have received a copy of the GNU General Public License 00024 along with yat. If not, see <http://www.gnu.org/licenses/>. 00025 */ 00026 00027 #include "yat/utility/Vector.h" 00028 00029 #include <iosfwd> 00030 00031 namespace theplu { 00032 namespace yat { 00033 namespace regression { 00034 00035 class Kernel; 00036 class OneDimensionalWeighted; 00037 00049 class Local 00050 { 00051 00052 public: 00057 Local(OneDimensionalWeighted& r, Kernel& k); 00058 00062 virtual ~Local(void); 00063 00067 void add(const double x, const double y); 00068 00076 void fit(const size_t step_size, const size_t nof_points); 00077 00083 void reset(void); 00084 00088 const utility::Vector& x(void) const; 00089 00093 const utility::Vector& y_predicted(void) const; 00094 00098 const utility::Vector& y_err(void) const; 00099 00100 private: 00104 Local(const Local&); 00105 00106 std::vector<std::pair<double, double> > data_; 00107 Kernel* kernel_; 00108 OneDimensionalWeighted* regressor_; 00109 utility::Vector x_; 00110 utility::Vector y_predicted_; 00111 utility::Vector y_err_; 00112 }; 00113 00119 std::ostream& operator<<(std::ostream&, const Local& ); 00120 00121 }}} // of namespaces regression, yat, and theplu 00122 00123 #endif