Ignore:
Timestamp:
01/16/13 20:00:01 (11 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-4770

Ready for Test: Yes

Interface Changes: Yes/No?

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...

Redefined Interpolator1D and derived classes as template class.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/BufferedLinearInterpolator1D.h

    r2730 r2733  
    2121 * @author TakeshiNakazato
    2222 */
    23 class BufferedLinearInterpolator1D : public Interpolator1D {
     23template <class T, class U>
     24class BufferedLinearInterpolator1D : public Interpolator1D<T, U> {
    2425public:
    2526  // Default constructor.
     
    3435  // @param[in] n number of data.
    3536  // @see Interpolator1D::setData()
    36   void setData(double *x, float *y, unsigned int n);
     37  void setData(T *x, U *y, unsigned int n);
    3738
    3839  // Set horizontal data (x).
     
    4041  // @param[in] n number of data.
    4142  // @see Interpolator1D::setX()
    42   void setX(double *x, unsigned int n);
     43  void setX(T *x, unsigned int n);
    4344
    4445  // Perform interpolation.
     
    4748  // @return interpolated value at x.
    4849  // @see Interpolator1D::interpolate()
    49   float interpolate(double x);
     50  U interpolate(T x);
    5051
    5152private:
    5253  // Numerical factor for linear interpolation.
    53   double factor_;
     54  T factor_;
    5455
    5556  // Previous location.
    56   double xold_;
     57  T xold_;
    5758
    5859  // Previous location as an index
     
    6465
    6566}
     67
     68#include "BufferedLinearInterpolator1D.tcc"
     69
    6670#endif
Note: See TracChangeset for help on using the changeset viewer.