interpax.CubicHermiteSpline.solve
- CubicHermiteSpline.solve(y: Real[Array, '...'] | Real[ndarray, '...'] | number | int | float = 0.0, discontinuity: bool = True, extrapolate: bool | str | None = None, size: int | None = None, fill_value: Real[Array, ''] | Real[ndarray, ''] | number | int | float = nan) Float[Array, '... size']Source
Find real solutions of the equation
pp(x) == y.- Parameters:
y (float or array_like, optional) – Right-hand side. Default is zero. If an array, it must be broadcastable to
c.shape[2:].discontinuity (bool, optional) – Whether to report sign changes across discontinuities at breakpoints as roots.
extrapolate ({bool, 'periodic', None}, optional) – If bool, determines whether to return roots from the polynomial extrapolated based on first and last intervals, ‘periodic’ works the same as False. If None (default), use self.extrapolate.
size (int, optional) – Length of the returned array of roots. If fewer roots exist, the result is padded with
fill_value. If more exist, only thesizesmallest are returned. Default is the largest number of roots that can be reported for a piecewise polynomial of this order and number of intervals.fill_value (float, optional) – Value used to pad the result when fewer than
sizeroots exist. Default is nan.
- Returns:
roots (ndarray, shape(…, size)) – Roots of the polynomial(s) in increasing order, followed by
fill_valuepadding. Leading dimensions arec.shape[2:].
Notes
This routine works only on real-valued polynomials.
If the piecewise polynomial contains sections that are identically equal to
y, the root list will contain the start point of the corresponding interval, followed by ananvalue.If the polynomial is discontinuous across a breakpoint, and there is a sign change across the breakpoint, this is reported if the
discontinuityparameter is True.Roots are differentiable with respect to the coefficients, breakpoints and
y, except for roots reported at discontinuities or identically zero sections.