class_docstr: 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.
class_docstr_tok: ["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","."]
code: def __init__(self, xi, yi, axis=0):
      _Interpolator1DWithDerivatives.__init__(self, xi, yi, axis)
  
      self.xi = xi.astype(cupy.float_)
      self.yi = self._reshape_yi(yi)
      self.n, self.r = self.yi.shape
  
      c = cupy.zeros((self.n + 1, self.r), dtype=self.dtype)
      c[0] = self.yi[0]
      Vk = cupy.zeros((self.n, self.r), dtype=self.dtype)
      for k in range(1, self.n):
          s = 0
          while s <= k and xi[k - s] == xi[k]:
              s += 1
          s -= 1
          Vk[0] = self.yi[k] / float_factorial(s)
          for i in range(k - s):
              if xi[i] == xi[k]:
                  raise ValueError("Elements if `xi` can't be equal.")
              if s == 0:
                  Vk[i + 1] = (c[i] - Vk[i]) / (xi[i] - xi[k])
              else:
                  Vk[i + 1] = (Vk[i + 1] - Vk[i]) / (xi[i] - xi[k])
          c[k] = Vk[k - s]
      self.c = c
  
imports: import cupy
  from cupyx.scipy._lib._util import _asarray_validated, float_factorial
label_desc: Use image node_id 1 to create a new KroghInterpolator object from inherited base classes: _Interpolator1DWithDerivatives with example: obj = KroghInterpolator(xi, yi, axis)