Changeset 2730 for trunk/src/BufferedLinearInterpolator1D.h
- Timestamp:
- 01/16/13 16:00:28 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/BufferedLinearInterpolator1D.h
r2727 r2730 18 18 19 19 /** 20 * Linear interpolation with some buffers 20 * Linear interpolation with some buffers for acceleration. 21 21 * @author TakeshiNakazato 22 22 */ 23 23 class BufferedLinearInterpolator1D : public Interpolator1D { 24 24 public: 25 // Default constructor. 25 26 BufferedLinearInterpolator1D(); 26 27 28 // Destructor. 27 29 virtual ~BufferedLinearInterpolator1D(); 28 30 31 // Set horizontal (x) and vertical (y) data. 32 // @param[in] x pointer to horizontal data. 33 // @param[in] y pointer to vertical data. 34 // @param[in] n number of data. 35 // @see Interpolator1D::setData() 36 void setData(double *x, float *y, unsigned int n); 37 38 // Set horizontal data (x). 39 // @param[in] x pointer to horizontal data. 40 // @param[in] n number of data. 41 // @see Interpolator1D::setX() 29 42 void setX(double *x, unsigned int n); 43 44 // Perform interpolation. 45 // @param[in] x horizontal location where the value is evaluated 46 // by interpolation. 47 // @return interpolated value at x. 48 // @see Interpolator1D::interpolate() 30 49 float interpolate(double x); 31 50 32 51 private: 52 // Numerical factor for linear interpolation. 33 53 double factor_; 54 55 // Previous location. 34 56 double xold_; 57 58 // Previous location as an index 35 59 unsigned int prev_; 60 61 // Boolean parameter whether buffered values are effective or not. 36 62 bool reusable_; 37 63 };
Note: See TracChangeset
for help on using the changeset viewer.