|Function||Polynomial interpolation of X-Y-table values|
|Syntax C/C++||#include <VFstd.h>
void VF_polyinterpol( fVector Y, fVector X, ui sizex, fVector XTab, fVector YTab, ui sizetab, unsigned deg );
|C++ VecObj||#include <OptiVec.h>
void vector<T>::polyinterpol( const vector<T>& X, const vector<T>& XTab, const vector<T>& YTab, unsigned deg );
procedure VF_polyinterpol( Y, X:fVector; sizex:UIntSize; XTab, YTab:fVector; sizetab:UIntSize; deg:UInt );
|Description||For each of the sizex elements of X, the corresponding element of Y is interpolated from the XTab-YTab value pairs. XTab must be ordered (either ascending or descending). All values of XTab must be distinct; otherwise a division by zero may occur and lead to a program abort. For each element of X, the routine finds itself the appropriate place in the table. The parameter deg denotes the number of points that will be taken into account for the interpolation (this is not the degree of the interpolating polynomial!). Any value between 0 and 2 will be interpreted as meaning linear interpolation. A maximum of 10-point interpolation is possible. deg may not be larger than sizetab-1.|
|Error handling||Trying to use too many elements for the interpolation (deg > 10) leads to an error message "Not possible with more than 10 elements" and to a program abort. If deg exceeds sizetab-1, an error message "Invalid parameter(s)" is displayed and the program aborted.
No other errors are detected (you have to take care yourself that the XTab values are distinct and that the YTab values are not near the limit of overflowing).
VectorLib Table of Contents OptiVec home