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

New Development: No

JIRA Issue: Yes CAS-4770

Ready for Test: Yes

Interface Changes: 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...

Rewrite implementations for locator and interpolator.
Documentation (doxygen format) is added to header files.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Interpolator1D.h

    r2727 r2730  
    2323class Interpolator1D {
    2424public:
     25  // Default constructor.
    2526  Interpolator1D();
    2627
     28  // Destructor.
    2729  virtual ~Interpolator1D();
    2830
     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.
    2935  void setData(double *x, float *y, unsigned int n);
     36
     37  // Set horizontal data (x).
     38  // @param[in] x pointer to horizontal data.
     39  // @param[in] n number of data.
    3040  void setX(double *x, unsigned int n);
     41
     42  // Set vertical data (y).
     43  // @param[in] y pointer to vertical data.
     44  // @param[in] n number of data.
    3145  void setY(float *y, unsigned int n);
     46
     47  // Reset object.
    3248  void reset();
    3349
    34   // currently only effective for polynomial interpolation
     50  // Set order for polynomial interpolation.
     51  // @param order order of the polynomial.
     52  //
     53  // This method is effective only for polynomial interpolation.
    3554  void setOrder(unsigned int order) {order_ = order;}
    3655
     56  // Perform interpolation.
     57  // @param[in] x horizontal location where the value is evaluated
     58  //              by interpolation.
     59  // @return interpolated value at x.
    3760  virtual float interpolate(double x) = 0;
    3861
    3962protected:
    40   int locate(double x);
     63  // Locate x.
     64  // @param[in] x horizontal location.
     65  // @return location as an index.
     66  // @see Locator::locate()
     67  unsigned int locate(double x);
     68
     69  // Query function whether the object is ready to interpolate.
     70  // @return true if object is ready else false.
    4171  bool isready();
     72
     73  // Fuctory method to create appropriate Locator object.
    4274  void createLocator();
    4375
     76  // Order of the polynomial (only effective for polynomial interpolation).
    4477  unsigned int order_;
     78
     79  // Number of data points.
    4580  unsigned int n_;
     81
     82  // Horizontal data.
    4683  double *x_;
     84
     85  // Vertical data.
    4786  float *y_;
     87
     88  // Pointer to the Locator object.
    4889  Locator *locator_;
    4990};
Note: See TracChangeset for help on using the changeset viewer.