| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330 |
- from typing import (
- Any,
- Literal,
- Optional,
- overload,
- )
- from collections.abc import Callable
- import numpy as np
- _IntegerType = int | np.integer
- _FloatingType = float | np.floating
- _PointsAndWeights = tuple[np.ndarray, np.ndarray]
- _PointsAndWeightsAndMu = tuple[np.ndarray, np.ndarray, float]
- _ArrayLike0D = bool | int | float | complex | str | bytes | np.generic
- __all__ = [
- 'legendre',
- 'chebyt',
- 'chebyu',
- 'chebyc',
- 'chebys',
- 'jacobi',
- 'laguerre',
- 'genlaguerre',
- 'hermite',
- 'hermitenorm',
- 'gegenbauer',
- 'sh_legendre',
- 'sh_chebyt',
- 'sh_chebyu',
- 'sh_jacobi',
- 'roots_legendre',
- 'roots_chebyt',
- 'roots_chebyu',
- 'roots_chebyc',
- 'roots_chebys',
- 'roots_jacobi',
- 'roots_laguerre',
- 'roots_genlaguerre',
- 'roots_hermite',
- 'roots_hermitenorm',
- 'roots_gegenbauer',
- 'roots_sh_legendre',
- 'roots_sh_chebyt',
- 'roots_sh_chebyu',
- 'roots_sh_jacobi',
- ]
- @overload
- def roots_jacobi(
- n: _IntegerType,
- alpha: _FloatingType,
- beta: _FloatingType,
- ) -> _PointsAndWeights: ...
- @overload
- def roots_jacobi(
- n: _IntegerType,
- alpha: _FloatingType,
- beta: _FloatingType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_jacobi(
- n: _IntegerType,
- alpha: _FloatingType,
- beta: _FloatingType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_sh_jacobi(
- n: _IntegerType,
- p1: _FloatingType,
- q1: _FloatingType,
- ) -> _PointsAndWeights: ...
- @overload
- def roots_sh_jacobi(
- n: _IntegerType,
- p1: _FloatingType,
- q1: _FloatingType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_sh_jacobi(
- n: _IntegerType,
- p1: _FloatingType,
- q1: _FloatingType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_genlaguerre(
- n: _IntegerType,
- alpha: _FloatingType,
- ) -> _PointsAndWeights: ...
- @overload
- def roots_genlaguerre(
- n: _IntegerType,
- alpha: _FloatingType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_genlaguerre(
- n: _IntegerType,
- alpha: _FloatingType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_laguerre(n: _IntegerType) -> _PointsAndWeights: ...
- @overload
- def roots_laguerre(
- n: _IntegerType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_laguerre(
- n: _IntegerType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_hermite(n: _IntegerType) -> _PointsAndWeights: ...
- @overload
- def roots_hermite(
- n: _IntegerType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_hermite(
- n: _IntegerType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_hermitenorm(n: _IntegerType) -> _PointsAndWeights: ...
- @overload
- def roots_hermitenorm(
- n: _IntegerType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_hermitenorm(
- n: _IntegerType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_gegenbauer(
- n: _IntegerType,
- alpha: _FloatingType,
- ) -> _PointsAndWeights: ...
- @overload
- def roots_gegenbauer(
- n: _IntegerType,
- alpha: _FloatingType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_gegenbauer(
- n: _IntegerType,
- alpha: _FloatingType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_chebyt(n: _IntegerType) -> _PointsAndWeights: ...
- @overload
- def roots_chebyt(
- n: _IntegerType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_chebyt(
- n: _IntegerType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_chebyu(n: _IntegerType) -> _PointsAndWeights: ...
- @overload
- def roots_chebyu(
- n: _IntegerType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_chebyu(
- n: _IntegerType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_chebyc(n: _IntegerType) -> _PointsAndWeights: ...
- @overload
- def roots_chebyc(
- n: _IntegerType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_chebyc(
- n: _IntegerType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_chebys(n: _IntegerType) -> _PointsAndWeights: ...
- @overload
- def roots_chebys(
- n: _IntegerType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_chebys(
- n: _IntegerType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_sh_chebyt(n: _IntegerType) -> _PointsAndWeights: ...
- @overload
- def roots_sh_chebyt(
- n: _IntegerType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_sh_chebyt(
- n: _IntegerType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_sh_chebyu(n: _IntegerType) -> _PointsAndWeights: ...
- @overload
- def roots_sh_chebyu(
- n: _IntegerType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_sh_chebyu(
- n: _IntegerType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_legendre(n: _IntegerType) -> _PointsAndWeights: ...
- @overload
- def roots_legendre(
- n: _IntegerType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_legendre(
- n: _IntegerType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- @overload
- def roots_sh_legendre(n: _IntegerType) -> _PointsAndWeights: ...
- @overload
- def roots_sh_legendre(
- n: _IntegerType,
- mu: Literal[False],
- ) -> _PointsAndWeights: ...
- @overload
- def roots_sh_legendre(
- n: _IntegerType,
- mu: Literal[True],
- ) -> _PointsAndWeightsAndMu: ...
- class orthopoly1d(np.poly1d):
- def __init__(
- self,
- roots: np.typing.ArrayLike,
- weights: np.typing.ArrayLike | None,
- hn: float = ...,
- kn: float = ...,
- wfunc = Optional[Callable[[float], float]], # noqa: UP045
- limits = tuple[float, float] | None,
- monic: bool = ...,
- eval_func: np.ufunc = ...,
- ) -> None: ...
- @property
- def limits(self) -> tuple[float, float]: ...
- def weight_func(self, x: float) -> float: ...
- @overload
- def __call__(self, x: _ArrayLike0D) -> Any: ...
- @overload
- def __call__(self, x: np.poly1d) -> np.poly1d: ... # type: ignore[overload-overlap]
- @overload
- def __call__(self, x: np.typing.ArrayLike) -> np.ndarray: ...
- def legendre(n: _IntegerType, monic: bool = ...) -> orthopoly1d: ...
- def chebyt(n: _IntegerType, monic: bool = ...) -> orthopoly1d: ...
- def chebyu(n: _IntegerType, monic: bool = ...) -> orthopoly1d: ...
- def chebyc(n: _IntegerType, monic: bool = ...) -> orthopoly1d: ...
- def chebys(n: _IntegerType, monic: bool = ...) -> orthopoly1d: ...
- def jacobi(
- n: _IntegerType,
- alpha: _FloatingType,
- beta: _FloatingType,
- monic: bool = ...,
- ) -> orthopoly1d: ...
- def laguerre(n: _IntegerType, monic: bool = ...) -> orthopoly1d: ...
- def genlaguerre(
- n: _IntegerType,
- alpha: _FloatingType,
- monic: bool = ...,
- ) -> orthopoly1d: ...
- def hermite(n: _IntegerType, monic: bool = ...) -> orthopoly1d: ...
- def hermitenorm(n: _IntegerType, monic: bool = ...) -> orthopoly1d: ...
- def gegenbauer(
- n: _IntegerType,
- alpha: _FloatingType,
- monic: bool = ...,
- ) -> orthopoly1d: ...
- def sh_legendre(n: _IntegerType, monic: bool = ...) -> orthopoly1d: ...
- def sh_chebyt(n: _IntegerType, monic: bool = ...) -> orthopoly1d: ...
- def sh_chebyu(n: _IntegerType, monic: bool = ...) -> orthopoly1d: ...
- def sh_jacobi(
- n: _IntegerType,
- p: _FloatingType,
- q: _FloatingType,
- monic: bool = ...,
- ) -> orthopoly1d: ...
- # These functions are not public, but still need stubs because they
- # get checked in the tests.
- def _roots_hermite_asy(n: _IntegerType) -> _PointsAndWeights: ...
|