#include <LinearInterpolator1D.h>
Inherits Interpolator::Interpolator1D.
Inheritance diagram for Interpolator::LinearInterpolator1D:


Public Member Functions | |
| LinearInterpolator1D () | |
| Default constructor. | |
| virtual | ~LinearInterpolator1D () |
| Destructor. | |
| LinearInterpolator1D (std::string sName, std::string sDescription, InterpolationData1D *mInterpolationData) | |
This constructor requires 3 parameters :
| |
| virtual double | getInterpolatedValue (double dValue) |
| Return the interpolated value for the wanted dValue. | |
| virtual void | updateInterpolator () |
| Method to update the interpolator according the new InterpolationData values. | |
Definition at line 18 of file LinearInterpolator1D.h.
|
|
Default constructor.
Definition at line 17 of file LinearInterpolator1D.cpp.
|
|
|
Destructor.
Definition at line 23 of file LinearInterpolator1D.cpp. References Interpolator::Interpolator1D::acc, and Interpolator::Interpolator1D::spline.
|
|
||||||||||||||||
|
This constructor requires 3 parameters :
Definition at line 33 of file LinearInterpolator1D.cpp. References Interpolator::Interpolator::_verb, Interpolator::Interpolator1D::acc, Interpolator::Interpolator1D::getNbData(), Interpolator::InterpolationData1D::getXValues(), Interpolator::InterpolationData1D::getYValues(), and Interpolator::Interpolator1D::spline. 00035 : 00036 Interpolator1D(sName,sDescription,"Linear",mInterpolationData) 00037 00038 { 00039 acc = gsl_interp_accel_alloc (); 00040 spline = gsl_spline_alloc (gsl_interp_linear, getNbData()); 00041 00042 if(Interpolator::_verb == true) cout << "Values at init" << endl; 00043 for (unsigned int i=0;i<getNbData();i++) 00044 { 00045 if(Interpolator::_verb == true) cout << i << " --> " << *(mInterpolationData->getXValues()+i) << " " << *(mInterpolationData->getYValues()+i) << endl; 00046 } 00047 00048 gsl_spline_init (spline, mInterpolationData->getXValues(), mInterpolationData->getYValues(), getNbData()); 00049 }
Here is the call graph for this function: ![]() |
|
|
Return the interpolated value for the wanted dValue.
Implements Interpolator::Interpolator1D. Definition at line 52 of file LinearInterpolator1D.cpp. References Interpolator::Interpolator::_verb, and Interpolator::Interpolator1D::acc. 00053 { 00054 if(Interpolator::_verb == true) cout << "Values used to interpolate : " << endl; 00055 for (unsigned int i=0;i<spline->size;i++) 00056 { 00057 if(Interpolator::_verb == true) cout << i << " --> " << *(spline->x+i) << " " << *(spline->y+i) << endl; 00058 } 00059 return gsl_spline_eval (spline, dValue, acc); 00060 00061 }
|
|
|
Method to update the interpolator according the new InterpolationData values.
Implements Interpolator::Interpolator1D. Definition at line 64 of file LinearInterpolator1D.cpp. References Interpolator::Interpolator1D::acc, Interpolator::Interpolator1D::getInterpolatedData(), and Interpolator::Interpolator1D::getNbData(). 00065 { 00066 gsl_spline_free (spline); 00067 gsl_interp_accel_free (acc); 00068 acc = gsl_interp_accel_alloc (); 00069 spline = gsl_spline_alloc (gsl_interp_linear, getNbData()); 00070 gsl_spline_init (spline, getInterpolatedData()->getXValues(), getInterpolatedData()->getYValues(), getNbData()); 00071 }
Here is the call graph for this function: ![]() |
1.4.5