summaryrefslogtreecommitdiff
path: root/numpy/polynomial/laguerre.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-06-20 16:49:49 -0600
committerCharles Harris <charlesr.harris@gmail.com>2013-06-20 17:31:35 -0600
commit12e06a261e8ea6b08002de8e9933fd43e5465df9 (patch)
tree527a2df97d58a190de018b4a917f3be06908f541 /numpy/polynomial/laguerre.py
parentb3755926f5e5dc9fde273a8bf53bd98238e8e2b8 (diff)
downloadnumpy-12e06a261e8ea6b08002de8e9933fd43e5465df9.tar.gz
BUG: Campanion Matrix was scalar, not matrix for degree 1.
The companion matrices returned by the various polynomial types was a scalar in the degree one case instead of a 2-D array. Fix that and add a test to check for that result. Closes #3459.
Diffstat (limited to 'numpy/polynomial/laguerre.py')
-rw-r--r--numpy/polynomial/laguerre.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/polynomial/laguerre.py b/numpy/polynomial/laguerre.py
index 1cc316bca..ea805e146 100644
--- a/numpy/polynomial/laguerre.py
+++ b/numpy/polynomial/laguerre.py
@@ -1571,7 +1571,7 @@ def lagcompanion(c):
if len(c) < 2:
raise ValueError('Series must have maximum degree of at least 1.')
if len(c) == 2:
- return np.array(1 + c[0]/c[1])
+ return np.array([[1 + c[0]/c[1]]])
n = len(c) - 1
mat = np.zeros((n, n), dtype=c.dtype)