diff options
author | Andrew Dawson <ajdawson@acm.org> | 2015-02-25 13:40:20 +0000 |
---|---|---|
committer | Andrew Dawson <ajdawson@acm.org> | 2015-06-19 10:07:11 +0100 |
commit | 49427504787e46bc394305901997d629f039fd19 (patch) | |
tree | 3d4a13af7a8f98be28c95109acd1ab860e64e3a3 /numpy/polynomial/legendre.py | |
parent | d033b6e19fc95a1f1fd6592de8318178368011b1 (diff) | |
download | numpy-49427504787e46bc394305901997d629f039fd19.tar.gz |
ENH: Take advantage of symmetry in leggauss.
The calculation of points and weights for Gauss-Legendre quadrature
can take advantage of the symmetry of the companion matrix when
computing its eigenvalues in order to speed up the computation.
Diffstat (limited to 'numpy/polynomial/legendre.py')
-rw-r--r-- | numpy/polynomial/legendre.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py index d2de28269..e97de703f 100644 --- a/numpy/polynomial/legendre.py +++ b/numpy/polynomial/legendre.py @@ -1711,7 +1711,7 @@ def leggauss(deg): # matrix is symmetric in this case in order to obtain better zeros. c = np.array([0]*deg + [1]) m = legcompanion(c) - x = la.eigvals(m) + x = la.eigvalsh(m) x.sort() # improve roots by one application of Newton |