[Numpy-svn] r3543 - in trunk/numpy: core/tests lib

numpy-svn@scip... numpy-svn@scip...
Fri Feb 9 11:34:37 CST 2007


Author: stefan
Date: 2007-02-09 11:34:23 -0600 (Fri, 09 Feb 2007)
New Revision: 3543

Modified:
   trunk/numpy/core/tests/test_regression.py
   trunk/numpy/lib/polynomial.py
Log:
Fix polymul bug.


Modified: trunk/numpy/core/tests/test_regression.py
===================================================================
--- trunk/numpy/core/tests/test_regression.py	2007-02-07 23:29:59 UTC (rev 3542)
+++ trunk/numpy/core/tests/test_regression.py	2007-02-09 17:34:23 UTC (rev 3543)
@@ -613,5 +613,9 @@
         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()

Modified: trunk/numpy/lib/polynomial.py
===================================================================
--- trunk/numpy/lib/polynomial.py	2007-02-07 23:29:59 UTC (rev 3542)
+++ trunk/numpy/lib/polynomial.py	2007-02-09 17:34:23 UTC (rev 3543)
@@ -383,6 +383,7 @@
     """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)



More information about the Numpy-svn mailing list