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/CubicSplineInterpolator1D.h

    r2730 r2733  
    2121 * @author TakeshiNakazato
    2222 */
    23 class CubicSplineInterpolator1D : public Interpolator1D {
     23template <class T, class U>
     24class CubicSplineInterpolator1D : public Interpolator1D<T, U> {
    2425public:
    2526  // Default constructor.
     
    3132  // Override Interpolator1D::setData.
    3233  // @see Interpolator1D::setData
    33   void setData(double *x, float *y, unsigned int n);
     34  void setData(T *x, U *y, unsigned int n);
    3435
    3536  // Override Interpolator1D::setY.
    3637  // @see Interpolator1D::setY()
    37   void setY(float *y, unsigned int n);
     38  void setY(U *y, unsigned int n);
    3839
    3940  // Perform interpolation.
     
    4142  //              by interpolation.
    4243  // @return interpolated value at x.
    43   float interpolate(double x);
     44  U interpolate(T x);
    4445private:
    4546  // Determine second derivatives of each point based on
     
    5354  // @param[in] i location index for x.
    5455  // @return interpolated value at x.
    55   float dospline(double x, unsigned int i);
     56  U dospline(T x, unsigned int i);
    5657 
    5758  // Array to store second derivatives on the data points.
    58   float *y2_;
     59  U *y2_;
    5960
    6061  // number of data points for second derivatives
     
    6667
    6768}
     69
     70#include "CubicSplineInterpolator1D.tcc"
     71
    6872#endif
Note: See TracChangeset for help on using the changeset viewer.