diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-06-20 16:49:49 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-06-20 17:31:35 -0600 |
commit | 12e06a261e8ea6b08002de8e9933fd43e5465df9 (patch) | |
tree | 527a2df97d58a190de018b4a917f3be06908f541 /numpy/polynomial/chebyshev.py | |
parent | b3755926f5e5dc9fde273a8bf53bd98238e8e2b8 (diff) | |
download | numpy-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/chebyshev.py')
-rw-r--r-- | numpy/polynomial/chebyshev.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/polynomial/chebyshev.py b/numpy/polynomial/chebyshev.py index dc1b27d76..db1b637fd 100644 --- a/numpy/polynomial/chebyshev.py +++ b/numpy/polynomial/chebyshev.py @@ -1795,7 +1795,7 @@ def chebcompanion(c): if len(c) < 2: raise ValueError('Series must have maximum degree of at least 1.') if len(c) == 2: - return np.array(-c[0]/c[1]) + return np.array([[-c[0]/c[1]]]) n = len(c) - 1 mat = np.zeros((n, n), dtype=c.dtype) |