diff options
| author | Stefan van der Walt <stefan@sun.ac.za> | 2007-02-09 17:34:23 +0000 |
|---|---|---|
| committer | Stefan van der Walt <stefan@sun.ac.za> | 2007-02-09 17:34:23 +0000 |
| commit | e7a51c37517f0fc62624c7e8e40d63ba416d096d (patch) | |
| tree | bb75d6d592b9808403d87ae2e6e1ef493ba5dc4a | |
| parent | a3237e0acf426698b4c08e0d107095ab11cb13a8 (diff) | |
| download | numpy-e7a51c37517f0fc62624c7e8e40d63ba416d096d.tar.gz | |
Fix polymul bug.
| -rw-r--r-- | numpy/core/tests/test_regression.py | 4 | ||||
| -rw-r--r-- | numpy/lib/polynomial.py | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py index 7ffd5ea14..38607ba27 100644 --- a/numpy/core/tests/test_regression.py +++ b/numpy/core/tests/test_regression.py @@ -613,5 +613,9 @@ class test_regression(NumpyTestCase): assert_array_equal(N.divide.accumulate(todivide), N.array([2., 4., 16.])) + def check_mem_polymul(self, level=rlevel): + """Ticket #448""" + N.polymul([],[1.]) + if __name__ == "__main__": NumpyTest().run() diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index ca61e34a3..f8bc1f693 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -383,6 +383,7 @@ def polymul(a1, a2): """Multiplies two polynomials represented as sequences. """ truepoly = (isinstance(a1, poly1d) or isinstance(a2, poly1d)) + a1,a2 = poly1d(a1),poly1d(a2) val = NX.convolve(a1, a2) if truepoly: val = poly1d(val) |
