- nearestNeighbour
- Crude but sometimes useful
- linear
- The most common method and the Default
- cubic
- Fits a third order polynomial to 4 pts
- spline
- Natural Cubic Splines
Interpolation can be done using the following methods:
The restriction that each absicssa have a unique value can be lifted by setting the uniq=True option in the appropriate functions. This imposes the followig additional restrictions on interpolation.
The abscissa must be a SampledFunctional that returns a scalar value that can be ordered. ie. an uInt, Int, Float or Double (not Complex). The ordinate can be any data type that has addition, and subtraction defined as well as multiplication by a scalar. So the ordinate can be complex numbers, where the interpolation is done separately on the real and imaginary components, or an array, where the interpolation is done separately on an element by element basis.
This class will curently make an internal copy of the data supplied to it, and sort the data if it is not told it is already sorted, by using the sorted=True flag.
Vector<Float> x(4); indgen(x); Vector<Double> y(4); indgen(y); y = y*y*y; ScalarSampledFunctional<Float> fx(x) ScalarSampledFunctional<Double> fy(y); Interpolate1D<Float, Double> gain(fx, fy); gain.setMethod(Interpolate1D<Float,Double>::cubic); for (Float xs = -1; xs < 5; xs += 0.1) cout << "gain(" << xs << "):" << gain(xs) << endl;
Construct an object with the specified data
Define a new data set for the class to operate on. Equivalent in many aspects to creating a new object.
The standard copy constructor, assignment operator and destructor. Internal data is copied in both cases (copy semantics)
Name of function
inquire/set the current interpolation method. uInts are used as arguments instead of the Interpolate1D::Method enumerator due to compiler limitations. See the example above (or the demo code) for the recommended way to call these functions.
Access the data set that interpolation is done over. This will usually be sorted.
A function to copy the Interpolate1D object