|Syntax C/C++||#include <VFmath.h>
void VF_ratinterpol( fVector Y, fVector X, ui sizex, fVector XTab, fVector YTab, ui sizetab, unsigned deg );
|C++ VecObj||#include <OptiVec.h>
void vector<T>::ratinterpol( const vector<T>& X, const vector<T>& XTab, const vector<T>& YTab, unsigned deg );
procedure VF_ratinterpol( 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. The parameter deg denotes the number of points that will be taken into account for the interpolation. The diagonal rational interpolation scheme by Stoer and Bulirsch is used. The interpolating function is formed by the quotient of two polynomials, the polynomial in the denominator being of the same order (for even deg) or of an order higher by one (for odd deg) than the polynomial of the numerator.
Diagonal rational interpolation is superior to polynomial interpolation, especially in the presence of poles. It is, however, much slower.
deg must be between 3 and 20.
|Error handling||A pole (infinity) in the interpolated function is recognized and leads to a SING error with the proposed result being ±HUGE_VAL. (Note: the x-value passed to _matherr is the first element of XTab). Trying to use too many elements for the interpolation (deg > 20) leads to an error message "Not possible with more than 20 elements" and to a program abort. If deg is not between 3 and 20, or exceeds sizetab-1, an error message "Invalid parameter(s)" is displayed and the program aborted.|
VectorLib Table of Contents OptiVec home