[Scipy-svn] r6954 - trunk/scipy/optimize

scipy-svn@scip... scipy-svn@scip...
Sun Nov 28 03:01:14 CST 2010


Author: rgommers
Date: 2010-11-28 03:01:14 -0600 (Sun, 28 Nov 2010)
New Revision: 6954

Modified:
   trunk/scipy/optimize/optimize.py
Log:
BUG: allow 2-D initial guess, same as for other solvers. Closes #843.

Modified: trunk/scipy/optimize/optimize.py
===================================================================
--- trunk/scipy/optimize/optimize.py	2010-11-28 08:56:36 UTC (rev 6953)
+++ trunk/scipy/optimize/optimize.py	2010-11-28 09:01:14 UTC (rev 6954)
@@ -66,11 +66,11 @@
 
 def rosen(x):
     """The Rosenbrock function.
-    
+
     The function computed is
 
         sum(100.0*(x[1:] - x[:-1]**2.0)**2.0 + (1 - x[:-1])**2.0
-    
+
     Parameters
     ----------
     x : array_like, 1D
@@ -453,7 +453,7 @@
     Optimization', 1999, pg. 198.
 
     """
-    x0 = asarray(x0).squeeze()
+    x0 = asarray(x0).flatten()
     if x0.ndim == 0:
         x0.shape = (1,)
     if maxiter is None:



More information about the Scipy-svn mailing list