summaryrefslogtreecommitdiff
path: root/numpy/polynomial/legendre.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/polynomial/legendre.py')
-rw-r--r--numpy/polynomial/legendre.py91
1 files changed, 43 insertions, 48 deletions
diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py
index 281982d0b..85fd5b18b 100644
--- a/numpy/polynomial/legendre.py
+++ b/numpy/polynomial/legendre.py
@@ -1,8 +1,7 @@
"""
-Legendre Series (:mod: `numpy.polynomial.legendre`)
-===================================================
-
-.. currentmodule:: numpy.polynomial.polynomial
+==================================================
+Legendre Series (:mod:`numpy.polynomial.legendre`)
+==================================================
This module provides a number of objects (mostly functions) useful for
dealing with Legendre series, including a `Legendre` class that
@@ -10,16 +9,23 @@ encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in the
docstring for its "parent" sub-package, `numpy.polynomial`).
+Classes
+-------
+.. autosummary::
+ :toctree: generated/
+
+ Legendre
+
Constants
---------
.. autosummary::
:toctree: generated/
- legdomain Legendre series default domain, [-1,1].
- legzero Legendre series that evaluates identically to 0.
- legone Legendre series that evaluates identically to 1.
- legx Legendre series for the identity map, ``f(x) = x``.
+ legdomain
+ legzero
+ legone
+ legx
Arithmetic
----------
@@ -27,17 +33,17 @@ Arithmetic
.. autosummary::
:toctree: generated/
- legadd add two Legendre series.
- legsub subtract one Legendre series from another.
- legmulx multiply a Legendre series in ``P_i(x)`` by ``x``.
- legmul multiply two Legendre series.
- legdiv divide one Legendre series by another.
- legpow raise a Legendre series to a positive integer power.
- legval evaluate a Legendre series at given points.
- legval2d evaluate a 2D Legendre series at given points.
- legval3d evaluate a 3D Legendre series at given points.
- leggrid2d evaluate a 2D Legendre series on a Cartesian product.
- leggrid3d evaluate a 3D Legendre series on a Cartesian product.
+ legadd
+ legsub
+ legmulx
+ legmul
+ legdiv
+ legpow
+ legval
+ legval2d
+ legval3d
+ leggrid2d
+ leggrid3d
Calculus
--------
@@ -45,8 +51,8 @@ Calculus
.. autosummary::
:toctree: generated/
- legder differentiate a Legendre series.
- legint integrate a Legendre series.
+ legder
+ legint
Misc Functions
--------------
@@ -54,36 +60,25 @@ Misc Functions
.. autosummary::
:toctree: generated/
- legfromroots create a Legendre series with specified roots.
- legroots find the roots of a Legendre series.
- legvander Vandermonde-like matrix for Legendre polynomials.
- legvander2d Vandermonde-like matrix for 2D power series.
- legvander3d Vandermonde-like matrix for 3D power series.
- leggauss Gauss-Legendre quadrature, points and weights.
- legweight Legendre weight function.
- legcompanion symmetrized companion matrix in Legendre form.
- legfit least-squares fit returning a Legendre series.
- legtrim trim leading coefficients from a Legendre series.
- legline Legendre series representing given straight line.
- leg2poly convert a Legendre series to a polynomial.
- poly2leg convert a polynomial to a Legendre series.
-
-Classes
--------
- Legendre A Legendre series class.
+ legfromroots
+ legroots
+ legvander
+ legvander2d
+ legvander3d
+ leggauss
+ legweight
+ legcompanion
+ legfit
+ legtrim
+ legline
+ leg2poly
+ poly2leg
See also
--------
-numpy.polynomial.polynomial
-numpy.polynomial.chebyshev
-numpy.polynomial.laguerre
-numpy.polynomial.hermite
-numpy.polynomial.hermite_e
+numpy.polynomial
"""
-from __future__ import division, absolute_import, print_function
-
-import warnings
import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
@@ -1229,7 +1224,7 @@ def legvander2d(x, y, deg):
.. versionadded:: 1.7.0
"""
- return pu._vander2d(legvander, x, y, deg)
+ return pu._vander_nd_flat((legvander, legvander), (x, y), deg)
def legvander3d(x, y, z, deg):
@@ -1283,7 +1278,7 @@ def legvander3d(x, y, z, deg):
.. versionadded:: 1.7.0
"""
- return pu._vander3d(legvander, x, y, z, deg)
+ return pu._vander_nd_flat((legvander, legvander, legvander), (x, y, z), deg)
def legfit(x, y, deg, rcond=None, full=False, w=None):