yat  0.13.2pre
GSLInterpolation.h
1 #ifndef _theplu_yat_regression_gslinterpolation_
2 #define _theplu_yat_regression_gslinterpolation_
3 
4 // $Id: GSLInterpolation.h 2992 2013-03-03 05:03:44Z peter $
5 
6 /*
7  Copyright (C) 2004, 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2009 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 <gsl/gsl_interp.h>
27 
28 namespace theplu {
29 namespace yat {
30 namespace utility {
31  class VectorBase;
32 }
33 namespace regression {
34 
60  {
61 
62  public:
76  GSLInterpolation(const gsl_interp_type*, const utility::VectorBase& x,
77  const utility::VectorBase& y);
78 
82  virtual ~GSLInterpolation(void)=0;
83 
93  double evaluate(double x);
94 
104  double evaluate_derivative(double x);
105 
115  double evaluate_derivative2(double x);
116 
126  double evaluate_integral(double a, double b);
127 
134  double evaluation(void) const;
135 
145  unsigned int min_size(void) const;
146 
147  private:
152  // no assignment
153  GSLInterpolation& operator=(const GSLInterpolation&);
154 
155  gsl_interp_accel* accelerator_;
156  double evaluation_;
157  gsl_interp* interpolator_;
158  double* x_;
159  double* y_;
160  };
161 
162 }}} // of namespaces regression, yat, and theplu
163 
164 #endif
virtual ~GSLInterpolation(void)=0
The destructor.
double evaluate(double x)
Calculate the interpolated value for x.
double evaluate_derivative2(double x)
Calculate the 2nd derivative of the interpolated function at x.
double evaluate_derivative(double x)
Calculate the derivative of the interpolated function at x.
GSLInterpolation(const gsl_interp_type *, const utility::VectorBase &x, const utility::VectorBase &y)
The default constructor.
This is the yat interface to GSL vector.
Definition: VectorBase.h:52
double evaluate_integral(double a, double b)
Calculate the numerical integral of the interpolated function over the range .
unsigned int min_size(void) const
This function returns the minimum number of points required by the interpolation type.
double evaluation(void) const
The result of the latest evaluaion function call is stored and can be retrieved with this function...
Base class for interfacing GSL interpolation.
Definition: GSLInterpolation.h:59

Generated on Wed Jan 4 2017 02:23:07 for yat by  doxygen 1.8.5