cupyx.scipy.interpolate.KroghInterpolator#

class cupyx.scipy.interpolate.KroghInterpolator(xi, yi, axis=0)[source]#

Interpolating polynomial for a set of points.

The polynomial passes through all the pairs (xi,yi). One may additionally specify a number of derivatives at each point xi; this is done by repeating the value xi and specifying the derivatives as successive yi values Allows evaluation of the polynomial and all its derivatives. For reasons of numerical stability, this function does not compute the coefficients of the polynomial, although they can be obtained by evaluating all the derivatives.

Parameters:
  • xi (cupy.ndarray, length N) – x-coordinate, must be sorted in increasing order

  • yi (cupy.ndarray) – y-coordinate, when a xi occurs two or more times in a row, the corresponding yi’s represent derivative values

  • axis (int, optional) – Axis in the yi array corresponding to the x-coordinate values.

Methods

__call__(x)[source]#

Evaluate the interpolant

Parameters:

x (cupy.ndarray) – The points to evaluate the interpolant

Returns:

y – Interpolated values. Shape is determined by replacing the interpolation axis in the original array with the shape of x

Return type:

cupy.ndarray

Notes

Input values x must be convertible to float values like int or float.

derivative(x, der=1)[source]#

Evaluate one derivative of the polynomial at the point x

Parameters:
  • x (cupy.ndarray) – Point or points at which to evaluate the derivatives

  • der (integer, optional) – Which derivative to extract. This number includes the function value as 0th derivative

Returns:

d – Derivative interpolated at the x-points. Shape of d is determined by replacing the interpolation axis in the original array with the shape of x

Return type:

cupy.ndarray

Notes

This is computed by evaluating all derivatives up to the desired one (using self.derivatives()) and then discarding the rest.

derivatives(x, der=None)[source]#

Evaluate many derivatives of the polynomial at the point x.

The function produce an array of all derivative values at the point x.

Parameters:
  • x (cupy.ndarray) – Point or points at which to evaluate the derivatives

  • der (int or None, optional) – How many derivatives to extract; None for all potentially nonzero derivatives (that is a number equal to the number of points). This number includes the function value as 0th derivative

Returns:

d – Array with derivatives; d[j] contains the jth derivative. Shape of d[j] is determined by replacing the interpolation axis in the original array with the shape of x

Return type:

cupy.ndarray

__eq__(value, /)#

Return self==value.

__ne__(value, /)#

Return self!=value.

__lt__(value, /)#

Return self<value.

__le__(value, /)#

Return self<=value.

__gt__(value, /)#

Return self>value.

__ge__(value, /)#

Return self>=value.