class_docstr: The interpolating polynomial for a set of points.
  
  Constructs a polynomial that passes through a given set of points.
  Allows evaluation of the polynomial, efficient changing of the y
  values to be interpolated, and updating by adding more x values.
  For reasons of numerical stability, this function does not compute
  the coefficients of the polynomial.
  The value `yi` need to be provided before the function is
  evaluated, but none of the preprocessing depends on them,
  so rapid updates are possible.
  
  Parameters
  ----------
  xi : cupy.ndarray
      1-D array of x-coordinates of the points the polynomial should
      pass through
  yi : cupy.ndarray, optional
      The y-coordinates of the points the polynomial should pass through.
      If None, the y values will be supplied later via the `set_y` method
  axis : int, optional
      Axis in the yi array corresponding to the x-coordinate values
  
  See Also
  --------
  scipy.interpolate.BarycentricInterpolator
class_docstr_tok: ["The","interpolating","polynomial","for","a","set","of","points",".","Constructs","a","polynomial","that","passes","through","a","given","set","of","points",".","Allows","evaluation","of","the","polynomial",",","efficient","changing","of","the","y","values","to","be","interpolated",",","and","updating","by","adding","more","x","values",".","For","reasons","of","numerical","stability",",","this","function","does","not","compute","the","coefficients","of","the","polynomial",".","The","value","`","yi","`","need","to","be","provided","before","the","function","is","evaluated",",","but","none","of","the","preprocessing","depends","on","them",",","so","rapid","updates","are","possible",".","Parameters","--","--","--","--","--","xi",":","cupy.ndarray","1-D","array","of","x-coordinates","of","the","points","the","polynomial","should","pass","through","yi",":","cupy.ndarray",",","optional","The","y-coordinates","of","the","points","the","polynomial","should","pass","through",".","If","None",",","the","y","values","will","be","supplied","later","via","the","`","set_y","`","method","axis",":","int",",","optional","Axis","in","the","yi","array","corresponding","to","the","x-coordinate","values","See","Also","--","--","--","--","scipy.interpolate.BarycentricInterpolator"]
code: def _evaluate(self, x):
      if x.size == 0:
          p = cupy.zeros((0, self.r), dtype=self.dtype)
      else:
          c = x[..., cupy.newaxis] - self.xi
          z = c == 0
          c[z] = 1
          c = self.wi / c
          p = (
              cupy.dot(c, self.yi)
              / cupy.sum(c, axis=-1)[..., cupy.newaxis]
          )
          r = cupy.nonzero(z)
          if len(r) == 1:  # evaluation at a scalar
              if len(r[0]) > 0:  # equals one of the points
                  p = self.yi[r[0][0]]
          else:
              p[r[:-1]] = self.yi[r[-1]]
      return p
  
imports: import cupy
  from cupyx.scipy._lib._util import _asarray_validated, float_factorial
label_desc: Use image node_id 5 for calling the BarycentricInterpolator obj's underlying member method code with example usage: obj._evaluate(x) and returns: p