numpy.polynomial.laguerre.lagval(x, c, tensor=True)
Evaluate a Laguerre series at points x.
c is of length
n + 1, this function returns the value:
x is converted to an array only if it is a tuple or a list, otherwise it is treated as a scalar. In either case, either
x or its elements must support multiplication and addition both with themselves and with the elements of
c is a 1-D array, then
p(x) will have the same shape as
c is multidimensional, then the shape of the result depends on the value of
tensor is true the shape will be c.shape[1:] + x.shape. If
tensor is false the shape will be c.shape[1:]. Note that scalars have shape (,).
Trailing zeros in the coefficients will be used in the evaluation, so they should be avoided if efficiency is a concern.
The evaluation uses Clenshaw recursion, aka synthetic division.
>>> from numpy.polynomial.laguerre import lagval >>> coef = [1,2,3] >>> lagval(1, coef) -0.5 >>> lagval([[1,2],[3,4]], coef) array([[-0.5, -4. ], [-4.5, -2. ]])
© 2005–2019 NumPy Developers
Licensed under the 3-clause BSD License.