FunctionDiagonal-rational interpolation
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 );
Pascal/Delphiuses VFmath;
procedure VF_ratinterpol( Y, X:fVector; sizex:UIntSize; XTab, YTab:fVector; sizetab:UIntSize; deg:UInt );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_ratinterpol( fVector d_Y, fVector d_X, ui sizex, fVector d_XTab, fVector d_YTab, ui sizetab, unsigned deg );
void VFcu_ratinterpol( fVector h_Y, fVector h_X, ui sizex, fVector h_XTab, fVector h_YTab, ui sizetab, unsigned deg );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_ratinterpol( d_Y, d_X:fVector; sizex:UIntSize; d_XTab, d_YTab:fVector; sizetab:UIntSize; deg:UInt ): IntBool;
procedure VFcu_ratinterpol( h_Y, h_X:fVector; sizex:UIntSize; h_XTab, h_YTab:fVector; sizetab:UIntSize; deg:UInt );
DescriptionFor 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.
For table data points with poles, diagonal rational interpolation is superior to polynomial interpolation. On the other hand, even the slightest round-off error may cause rational interpolation to generate a pole where one would not expect one, especially in extrapolation.
deg must be between 3 and 20.
Error handlingA 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.
Return valuenone
See alsoVF_polyinterpol,   VF_splineinterpol

VectorLib Table of Contents  OptiVec home