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

    r2731 r2733  
    2121 * @author TakeshiNakazato
    2222 */
    23 class Interpolator1D {
     23template <class T, class U> class Interpolator1D {
    2424public:
    2525  // Default constructor.
     
    3333  // @param[in] y pointer to vertical data.
    3434  // @param[in] n number of data.
    35   void setData(double *x, float *y, unsigned int n);
     35  void setData(T *x, U *y, unsigned int n);
    3636
    3737  // Set horizontal data (x).
    3838  // @param[in] x pointer to horizontal data.
    3939  // @param[in] n number of data.
    40   void setX(double *x, unsigned int n);
     40  void setX(T *x, unsigned int n);
    4141
    4242  // Set vertical data (y).
    4343  // @param[in] y pointer to vertical data.
    4444  // @param[in] n number of data.
    45   void setY(float *y, unsigned int n);
     45  void setY(U *y, unsigned int n);
    4646
    4747  // Reset object.
     
    5858  //              by interpolation.
    5959  // @return interpolated value at x.
    60   virtual float interpolate(double x) = 0;
     60  virtual U interpolate(T x) = 0;
    6161
    6262protected:
     
    6565  // @return location as an index.
    6666  // @see Locator::locate()
    67   unsigned int locate(double x);
     67  unsigned int locate(T x);
    6868
    6969  // Query function whether the object is ready to interpolate.
     
    8181
    8282  // Horizontal data.
    83   double *x_;
     83  T *x_;
    8484
    8585  // Vertical data.
    86   float *y_;
     86  U *y_;
    8787
    8888  // Pointer to the Locator object.
    89   Locator<double> *locator_;
     89  Locator<T> *locator_;
    9090};
    9191
    9292}
     93
     94#include "Interpolator1D.tcc"
     95
    9396#endif
Note: See TracChangeset for help on using the changeset viewer.