[Scipy-svn] r3186 - trunk/Lib/optimize

scipy-svn@scip... scipy-svn@scip...
Tue Jul 24 05:38:03 CDT 2007


Author: dmitrey.kroshko
Date: 2007-07-24 05:37:50 -0500 (Tue, 24 Jul 2007)
New Revision: 3186

Modified:
   trunk/Lib/optimize/tnc.py
Log:
tnc: x0 is allowed to be numpy.array (ticket 384)


Modified: trunk/Lib/optimize/tnc.py
===================================================================
--- trunk/Lib/optimize/tnc.py	2007-07-24 09:29:41 UTC (rev 3185)
+++ trunk/Lib/optimize/tnc.py	2007-07-24 10:37:50 UTC (rev 3186)
@@ -171,7 +171,7 @@
 
   fixed_point -- scalar fixed-point finder
 """
-
+    x0 = asarray(x0, dtype=float).tolist()
     n = len(x0)
 
     if bounds is None:
@@ -285,7 +285,7 @@
         dif[0] = -2.0*(x[1]-x[0])*1.0e-5
         dif[1] = 1.0-dif[0]
         return f, dif
-    tests.append ((test3fg, [10,1], ([-HUGE_VAL, 0.0], None), [0,0]))
+    tests.append ((test3fg, asarray([10,1]), ([-HUGE_VAL, 0.0], None), [0,0]))
 
     def test4fg(x):
         f = pow(x[0]+1.0,3)/3.0+x[1]



More information about the Scipy-svn mailing list