summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2012-01-03 10:40:49 -0700
committerCharles Harris <charlesr.harris@gmail.com>2012-01-09 11:09:38 -0700
commit894d93e98c6b35037829dc4f78fd86245becb7ff (patch)
tree0b3e5316a99b336daf26befcba4bfde8d711f233
parent0402e1c6a5cc5693a1f021446f20baebe9073890 (diff)
downloadnumpy-894d93e98c6b35037829dc4f78fd86245becb7ff.tar.gz
DOC: Clarify the column order of 2-D and 3-D Vandermonde matrices.
-rw-r--r--numpy/polynomial/chebyshev.py32
-rw-r--r--numpy/polynomial/hermite.py32
-rw-r--r--numpy/polynomial/hermite_e.py32
-rw-r--r--numpy/polynomial/laguerre.py32
-rw-r--r--numpy/polynomial/legendre.py32
-rw-r--r--numpy/polynomial/polynomial.py32
6 files changed, 120 insertions, 72 deletions
diff --git a/numpy/polynomial/chebyshev.py b/numpy/polynomial/chebyshev.py
index 22dc6a88c..022dccfa7 100644
--- a/numpy/polynomial/chebyshev.py
+++ b/numpy/polynomial/chebyshev.py
@@ -1470,12 +1470,16 @@ def chebvander2d(x, y, deg) :
`V` index the points `(x, y)` and the last index encodes the degrees of
the Chebyshev polynomials.
- If `c` is a 2-D array of coefficients of shape `(m + 1, n + 1)` and `V`
- is the matrix ``V = chebvander2d(x, y, [m, n])``, then
- ``np.dot(V, c.flat)`` and ``chebval2d(x, y, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 2-D Chebyshev series of the
- same degrees and sample points.
+ If ``V = chebvander2d(x, y, [xdeg, ydeg])``, then the columns of `V`
+ correspond to the elements of a 2-D coefficient array `c` of shape
+ (xdeg + 1, ydeg + 1) in the order
+
+ .. math:: c_{00}, c_{01}, c_{02} ... , c_{10}, c_{11}, c_{12} ...
+
+ and ``np.dot(V, c.flat)`` and ``chebval2d(x, y, c)`` will be the same
+ up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 2-D Chebyshev
+ series of the same degrees and sample points.
Parameters
----------
@@ -1530,12 +1534,16 @@ def chebvander3d(x, y, z, deg) :
indices of `V` index the points `(x, y, z)` and the last index encodes
the degrees of the Chebyshev polynomials.
- If `c` is a 3-D array of coefficients of shape `(l + 1, m + 1, n + 1)`
- and `V` is the matrix ``V = chebvander3d(x, y, z, [l, m, n])``, then
- ``np.dot(V, c.flat)`` and ``chebval3d(x, y, z, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 3-D Chebyshev series of the
- same degrees and sample points.
+ If ``V = chebvander3d(x, y, z, [xdeg, ydeg, zdeg])``, then the columns
+ of `V` correspond to the elements of a 3-D coefficient array `c` of
+ shape (xdeg + 1, ydeg + 1, zdeg + 1) in the order
+
+ .. math:: c_{000}, c_{001}, c_{002},... , c_{010}, c_{011}, c_{012},...
+
+ and ``np.dot(V, c.flat)`` and ``chebval3d(x, y, z, c)`` will be the
+ same up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 3-D Chebyshev
+ series of the same degrees and sample points.
Parameters
----------
diff --git a/numpy/polynomial/hermite.py b/numpy/polynomial/hermite.py
index e8b19de4c..627232d7c 100644
--- a/numpy/polynomial/hermite.py
+++ b/numpy/polynomial/hermite.py
@@ -1242,12 +1242,16 @@ def hermvander2d(x, y, deg) :
`V` index the points `(x, y)` and the last index encodes the degrees of
the Hermite polynomials.
- If `c` is a 2-D array of coefficients of shape `(m + 1, n + 1)` and `V`
- is the matrix ``V = hermvander2d(x, y, [m, n])``, then
- ``np.dot(V, c.flat)`` and ``hermval2d(x, y, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 2-D Hermite series of the same
- degrees and sample points.
+ If ``V = hermvander2d(x, y, [xdeg, ydeg])``, then the columns of `V`
+ correspond to the elements of a 2-D coefficient array `c` of shape
+ (xdeg + 1, ydeg + 1) in the order
+
+ .. math:: c_{00}, c_{01}, c_{02} ... , c_{10}, c_{11}, c_{12} ...
+
+ and ``np.dot(V, c.flat)`` and ``hermval2d(x, y, c)`` will be the same
+ up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 2-D Hermite
+ series of the same degrees and sample points.
Parameters
----------
@@ -1302,12 +1306,16 @@ def hermvander3d(x, y, z, deg) :
indices of `V` index the points `(x, y, z)` and the last index encodes
the degrees of the Hermite polynomials.
- If `c` is a 3-D array of coefficients of shape `(l + 1, m + 1, n + 1)`
- and `V` is the matrix ``V = hermvander3d(x, y, z, [l, m, n])``, then
- ``np.dot(V, c.flat)`` and ``hermval3d(x, y, z, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 3-D Hermite series of the
- same degrees and sample points.
+ If ``V = hermvander3d(x, y, z, [xdeg, ydeg, zdeg])``, then the columns
+ of `V` correspond to the elements of a 3-D coefficient array `c` of
+ shape (xdeg + 1, ydeg + 1, zdeg + 1) in the order
+
+ .. math:: c_{000}, c_{001}, c_{002},... , c_{010}, c_{011}, c_{012},...
+
+ and ``np.dot(V, c.flat)`` and ``hermval3d(x, y, z, c)`` will be the
+ same up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 3-D Hermite
+ series of the same degrees and sample points.
Parameters
----------
diff --git a/numpy/polynomial/hermite_e.py b/numpy/polynomial/hermite_e.py
index 61745e261..daed05008 100644
--- a/numpy/polynomial/hermite_e.py
+++ b/numpy/polynomial/hermite_e.py
@@ -1238,12 +1238,16 @@ def hermevander2d(x, y, deg) :
`V` index the points `(x, y)` and the last index encodes the degrees of
the HermiteE polynomials.
- If `c` is a 2-D array of coefficients of shape `(m + 1, n + 1)` and `V`
- is the matrix ``V = hermevander2d(x, y, [m, n])``, then
- ``np.dot(V, c.flat)`` and ``hermeval2d(x, y, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 2-D HermiteE series of the same
- degrees and sample points.
+ If ``V = hermevander2d(x, y, [xdeg, ydeg])``, then the columns of `V`
+ correspond to the elements of a 2-D coefficient array `c` of shape
+ (xdeg + 1, ydeg + 1) in the order
+
+ .. math:: c_{00}, c_{01}, c_{02} ... , c_{10}, c_{11}, c_{12} ...
+
+ and ``np.dot(V, c.flat)`` and ``hermeval2d(x, y, c)`` will be the same
+ up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 2-D HermiteE
+ series of the same degrees and sample points.
Parameters
----------
@@ -1298,12 +1302,16 @@ def hermevander3d(x, y, z, deg) :
indices of `V` index the points `(x, y, z)` and the last index encodes
the degrees of the HermiteE polynomials.
- If `c` is a 3-D array of coefficients of shape `(l + 1, m + 1, n + 1)`
- and `V` is the matrix ``V = hermevander3d(x, y, z, [l, m, n])``, then
- ``np.dot(V, c.flat)`` and ``hermeval3d(x, y, z, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 3-D HermiteE series of the
- same degrees and sample points.
+ If ``V = hermevander3d(x, y, z, [xdeg, ydeg, zdeg])``, then the columns
+ of `V` correspond to the elements of a 3-D coefficient array `c` of
+ shape (xdeg + 1, ydeg + 1, zdeg + 1) in the order
+
+ .. math:: c_{000}, c_{001}, c_{002},... , c_{010}, c_{011}, c_{012},...
+
+ and ``np.dot(V, c.flat)`` and ``hermeval3d(x, y, z, c)`` will be the
+ same up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 3-D HermiteE
+ series of the same degrees and sample points.
Parameters
----------
diff --git a/numpy/polynomial/laguerre.py b/numpy/polynomial/laguerre.py
index abf31b07b..fc9afec00 100644
--- a/numpy/polynomial/laguerre.py
+++ b/numpy/polynomial/laguerre.py
@@ -1241,12 +1241,16 @@ def lagvander2d(x, y, deg) :
`V` index the points `(x, y)` and the last index encodes the degrees of
the Laguerre polynomials.
- If `c` is a 2-D array of coefficients of shape `(m + 1, n + 1)` and `V`
- is the matrix ``V = lagvander2d(x, y, [m, n])``, then
- ``np.dot(V, c.flat)`` and ``lagval2d(x, y, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 2-D Laguerre series of the same
- degrees and sample points.
+ If ``V = lagvander2d(x, y, [xdeg, ydeg])``, then the columns of `V`
+ correspond to the elements of a 2-D coefficient array `c` of shape
+ (xdeg + 1, ydeg + 1) in the order
+
+ .. math:: c_{00}, c_{01}, c_{02} ... , c_{10}, c_{11}, c_{12} ...
+
+ and ``np.dot(V, c.flat)`` and ``lagval2d(x, y, c)`` will be the same
+ up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 2-D Laguerre
+ series of the same degrees and sample points.
Parameters
----------
@@ -1301,12 +1305,16 @@ def lagvander3d(x, y, z, deg) :
indices of `V` index the points `(x, y, z)` and the last index encodes
the degrees of the Laguerre polynomials.
- If `c` is a 3-D array of coefficients of shape `(l + 1, m + 1, n + 1)`
- and `V` is the matrix ``V = lagvander3d(x, y, z, [l, m, n])``, then
- ``np.dot(V, c.flat)`` and ``lagval3d(x, y, z, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 3-D Laguerre series of the
- same degrees and sample points.
+ If ``V = lagvander3d(x, y, z, [xdeg, ydeg, zdeg])``, then the columns
+ of `V` correspond to the elements of a 3-D coefficient array `c` of
+ shape (xdeg + 1, ydeg + 1, zdeg + 1) in the order
+
+ .. math:: c_{000}, c_{001}, c_{002},... , c_{010}, c_{011}, c_{012},...
+
+ and ``np.dot(V, c.flat)`` and ``lagval3d(x, y, z, c)`` will be the
+ same up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 3-D Laguerre
+ series of the same degrees and sample points.
Parameters
----------
diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py
index c010c71a2..8fd64985b 100644
--- a/numpy/polynomial/legendre.py
+++ b/numpy/polynomial/legendre.py
@@ -1271,12 +1271,16 @@ def legvander2d(x, y, deg) :
`V` index the points `(x, y)` and the last index encodes the degrees of
the Legendre polynomials.
- If `c` is a 2-D array of coefficients of shape `(m + 1, n + 1)` and `V`
- is the matrix ``V = legvander2d(x, y, [m, n])``, then
- ``np.dot(V, c.flat)`` and ``legval2d(x, y, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 2-D Legendre series of the same
- degrees and sample points.
+ If ``V = legvander2d(x, y, [xdeg, ydeg])``, then the columns of `V`
+ correspond to the elements of a 2-D coefficient array `c` of shape
+ (xdeg + 1, ydeg + 1) in the order
+
+ .. math:: c_{00}, c_{01}, c_{02} ... , c_{10}, c_{11}, c_{12} ...
+
+ and ``np.dot(V, c.flat)`` and ``legval2d(x, y, c)`` will be the same
+ up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 2-D Legendre
+ series of the same degrees and sample points.
Parameters
----------
@@ -1331,12 +1335,16 @@ def legvander3d(x, y, z, deg) :
indices of `V` index the points `(x, y, z)` and the last index encodes
the degrees of the Legendre polynomials.
- If `c` is a 3-D array of coefficients of shape `(l + 1, m + 1, n + 1)`
- and `V` is the matrix ``V = legvander3d(x, y, z, [l, m, n])``, then
- ``np.dot(V, c.flat)`` and ``legval3d(x, y, z, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 3-D Legendre series of the same
- degrees and sample points.
+ If ``V = legvander3d(x, y, z, [xdeg, ydeg, zdeg])``, then the columns
+ of `V` correspond to the elements of a 3-D coefficient array `c` of
+ shape (xdeg + 1, ydeg + 1, zdeg + 1) in the order
+
+ .. math:: c_{000}, c_{001}, c_{002},... , c_{010}, c_{011}, c_{012},...
+
+ and ``np.dot(V, c.flat)`` and ``legval3d(x, y, z, c)`` will be the
+ same up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 3-D Legendre
+ series of the same degrees and sample points.
Parameters
----------
diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py
index 01197af12..9c8c077f0 100644
--- a/numpy/polynomial/polynomial.py
+++ b/numpy/polynomial/polynomial.py
@@ -1078,12 +1078,16 @@ def polyvander2d(x, y, deg) :
`V` index the points `(x, y)` and the last index encodes the powers of
`x` and `y`.
- If `c` is a 2-D array of coefficients of shape `(m + 1, n + 1)` and `V`
- is the matrix ``V = polyvander2d(x, y, [m, n])``, then
- ``np.dot(V, c.flat)`` and ``polyval2d(x, y, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 2-D polynomials of the same
- degrees and sample points.
+ If ``V = polyvander2d(x, y, [xdeg, ydeg])``, then the columns of `V`
+ correspond to the elements of a 2-D coefficient array `c` of shape
+ (xdeg + 1, ydeg + 1) in the order
+
+ .. math:: c_{00}, c_{01}, c_{02} ... , c_{10}, c_{11}, c_{12} ...
+
+ and ``np.dot(V, c.flat)`` and ``polyval2d(x, y, c)`` will be the same
+ up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 2-D polynomials
+ of the same degrees and sample points.
Parameters
----------
@@ -1135,12 +1139,16 @@ def polyvander3d(x, y, z, deg) :
indices of `V` index the points `(x, y, z)` and the last index encodes
the powers of `x`, `y`, and `z`.
- If `c` is a 3-D array of coefficients of shape `(l + 1, m + 1, n + 1)`
- and `V` is the matrix ``V = polyvander3d(x, y, z, [l, m, n])``, then
- ``np.dot(V, c.flat)`` and ``polyval3d(x, y, z, c)`` are the same up to
- roundoff. This equivalence is useful both for least squares fitting and
- for the evaluation of a large number of 3-D polynomials of the same
- degrees and sample points.
+ If ``V = polyvander3d(x, y, z, [xdeg, ydeg, zdeg])``, then the columns
+ of `V` correspond to the elements of a 3-D coefficient array `c` of
+ shape (xdeg + 1, ydeg + 1, zdeg + 1) in the order
+
+ .. math:: c_{000}, c_{001}, c_{002},... , c_{010}, c_{011}, c_{012},...
+
+ and ``np.dot(V, c.flat)`` and ``polyval3d(x, y, z, c)`` will be the
+ same up to roundoff. This equivalence is useful both for least squares
+ fitting and for the evaluation of a large number of 3-D polynomials
+ of the same degrees and sample points.
Parameters
----------