polynomial.pyi 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. from typing import Any, ClassVar, Final, overload
  2. import numpy as np
  3. import numpy.typing as npt
  4. from numpy._typing import (
  5. _ArrayLikeFloat_co,
  6. _ArrayLikeNumber_co,
  7. _FloatLike_co,
  8. _NumberLike_co,
  9. )
  10. from ._polybase import ABCPolyBase
  11. from ._polytypes import (
  12. _Array1,
  13. _Array2,
  14. _ArrayLikeCoef_co,
  15. _FuncBinOp,
  16. _FuncCompanion,
  17. _FuncDer,
  18. _FuncFit,
  19. _FuncFromRoots,
  20. _FuncInteg,
  21. _FuncLine,
  22. _FuncPow,
  23. _FuncRoots,
  24. _FuncUnOp,
  25. _FuncVal,
  26. _FuncVal2D,
  27. _FuncVal3D,
  28. _FuncVander,
  29. _FuncVander2D,
  30. _FuncVander3D,
  31. )
  32. from .polyutils import trimcoef as polytrim
  33. __all__ = [
  34. "polyzero",
  35. "polyone",
  36. "polyx",
  37. "polydomain",
  38. "polyline",
  39. "polyadd",
  40. "polysub",
  41. "polymulx",
  42. "polymul",
  43. "polydiv",
  44. "polypow",
  45. "polyval",
  46. "polyvalfromroots",
  47. "polyder",
  48. "polyint",
  49. "polyfromroots",
  50. "polyvander",
  51. "polyfit",
  52. "polytrim",
  53. "polyroots",
  54. "Polynomial",
  55. "polyval2d",
  56. "polyval3d",
  57. "polygrid2d",
  58. "polygrid3d",
  59. "polyvander2d",
  60. "polyvander3d",
  61. "polycompanion",
  62. ]
  63. polydomain: Final[_Array2[np.float64]] = ...
  64. polyzero: Final[_Array1[np.int_]] = ...
  65. polyone: Final[_Array1[np.int_]] = ...
  66. polyx: Final[_Array2[np.int_]] = ...
  67. polyline: Final[_FuncLine] = ...
  68. polyfromroots: Final[_FuncFromRoots] = ...
  69. polyadd: Final[_FuncBinOp] = ...
  70. polysub: Final[_FuncBinOp] = ...
  71. polymulx: Final[_FuncUnOp] = ...
  72. polymul: Final[_FuncBinOp] = ...
  73. polydiv: Final[_FuncBinOp] = ...
  74. polypow: Final[_FuncPow] = ...
  75. polyder: Final[_FuncDer] = ...
  76. polyint: Final[_FuncInteg] = ...
  77. polyval: Final[_FuncVal] = ...
  78. polyval2d: Final[_FuncVal2D] = ...
  79. polyval3d: Final[_FuncVal3D] = ...
  80. @overload
  81. def polyvalfromroots(x: _FloatLike_co, r: _FloatLike_co, tensor: bool = True) -> np.float64 | Any: ...
  82. @overload
  83. def polyvalfromroots(x: _NumberLike_co, r: _NumberLike_co, tensor: bool = True) -> np.complex128 | Any: ...
  84. @overload
  85. def polyvalfromroots(x: _ArrayLikeFloat_co, r: _ArrayLikeFloat_co, tensor: bool = True) -> npt.NDArray[np.float64 | Any]: ...
  86. @overload
  87. def polyvalfromroots(x: _ArrayLikeNumber_co, r: _ArrayLikeNumber_co, tensor: bool = True) -> npt.NDArray[np.complex128 | Any]: ...
  88. @overload
  89. def polyvalfromroots(x: _ArrayLikeCoef_co, r: _ArrayLikeCoef_co, tensor: bool = True) -> npt.NDArray[np.object_ | Any]: ...
  90. polygrid2d: Final[_FuncVal2D] = ...
  91. polygrid3d: Final[_FuncVal3D] = ...
  92. polyvander: Final[_FuncVander] = ...
  93. polyvander2d: Final[_FuncVander2D] = ...
  94. polyvander3d: Final[_FuncVander3D] = ...
  95. polyfit: Final[_FuncFit] = ...
  96. polycompanion: Final[_FuncCompanion] = ...
  97. polyroots: Final[_FuncRoots] = ...
  98. class Polynomial(ABCPolyBase[None]):
  99. basis_name: ClassVar[None] = None # pyright: ignore[reportIncompatibleMethodOverride]
  100. domain: _Array2[np.float64 | Any] = ... # pyright: ignore[reportIncompatibleMethodOverride]
  101. window: _Array2[np.float64 | Any] = ... # pyright: ignore[reportIncompatibleMethodOverride]