mindspore.numpy.polyint
- mindspore.numpy.polyint(p, m=1, k=None)[source]
Returns an antiderivative (indefinite integral) of a polynomial.
Note
Numpy object poly1d is currently not supported.
- Parameters
p (Union[int, float, bool, list, tuple, Tensor) – Polynomial to integrate. A sequence is interpreted as polynomial coefficients.
m (int, optional) – Defaults to 1, Order of the antiderivative.
k (Union[int, list of int]y, optinoal) – Integration constants. They are given in the order of integration: those corresponding to highest-order terms come first. If None (default), all constants are assumed to be zero. If
m = 1
, a single scalar can be given instead of a list.
- Returns
Tensor, a new polynomial representing the antiderivative.
- Raises
ValueError – if p has more than 1 dimensions.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore.numpy as np >>> print(np.polyint([1, 1, 1])) [0.33333334 0.5 1. 0. ]