CLinearInterpolator.h
Go to the documentation of this file.
1 #ifndef imath_CLinearInterpolator_included
2 #define imath_CLinearInterpolator_included
3 
4 
5 // Qt includes
6 #include <QtCore/QMap>
7 
8 // ACF includes
9 #include <imath/TIMathFunction.h>
10 
11 
12 namespace imath
13 {
14 
15 
20 class CLinearInterpolator: public virtual IDoubleFunction
21 {
22 public:
27  CLinearInterpolator(double* positions, double* values, int nodesCount, bool isExtrapolationEnabled = false);
28 
29  void SetNodes(double* positions, double* values, int nodesCount);
30 
31  // reimplemented (imath::TIMathFunction<double, double>)
32  virtual bool GetValueAt(const double& argument, double& result) const;
33  virtual double GetValueAt(const double& argument) const;
34 
35 private:
36  typedef QMap<double, double> Nodes;
37  Nodes m_nodes;
38  bool m_isExtrapolationEnabled;
39 };
40 
41 
42 } // namespace imath
43 
44 
45 #endif // !imath_CLinearInterpolator_included
46 
47 
virtual bool GetValueAt(const double &argument, double &result) const
void SetNodes(double *positions, double *values, int nodesCount)
Template interface for any mathematical function.
Implementation of a linear interpolator.

© 2007-2017 Witold Gantzke and Kirill Lepskiy