diff options
author | Tyler Moncur <mtmoncur@gmail.com> | 2019-04-08 17:00:10 -0600 |
---|---|---|
committer | Tyler Moncur <mtmoncur@gmail.com> | 2019-04-08 17:21:36 -0600 |
commit | 732d52a4c3cd91b8a2e20b99823fcd233dc32112 (patch) | |
tree | e0e83571bb563ead4ebbe5f8967b898c78aef518 /numpy/polynomial/laguerre.py | |
parent | 96cacd74e50d972df8f6c8704b0f4b3c3dfbc81c (diff) | |
download | numpy-732d52a4c3cd91b8a2e20b99823fcd233dc32112.tar.gz |
ENH: rotate companion matrix for all polynomial bases
Diffstat (limited to 'numpy/polynomial/laguerre.py')
-rw-r--r-- | numpy/polynomial/laguerre.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/polynomial/laguerre.py b/numpy/polynomial/laguerre.py index 41d15142a..e103dde92 100644 --- a/numpy/polynomial/laguerre.py +++ b/numpy/polynomial/laguerre.py @@ -1475,7 +1475,8 @@ def lagroots(c): if len(c) == 2: return np.array([1 + c[0]/c[1]]) - m = lagcompanion(c) + # rotated companion matrix reduces error + m = lagcompanion(c)[::-1,::-1] r = la.eigvals(m) r.sort() return r |