interpax.PPoly.roots
- PPoly.roots(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 roots of the piecewise polynomial.
- Parameters:
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:].
See also