[Scipy-tickets] [SciPy] #544: optimize.fminbound doesn't work with dimensions > 1

SciPy scipy-tickets@scipy....
Fri Nov 23 06:27:22 CST 2007


#544: optimize.fminbound doesn't work with dimensions > 1
----------------------------+-----------------------------------------------
 Reporter:  eikevons        |       Owner:  somebody
     Type:  defect          |      Status:  new     
 Priority:  normal          |   Milestone:  0.7     
Component:  scipy.optimize  |     Version:          
 Severity:  normal          |    Keywords:          
----------------------------+-----------------------------------------------
 Hello,

 when I try to use the optimize.fminbound method for multidimensional
 problems I get the following error:
 {{{
 #!python
 >>> from scipy import *
 >>> optimize.fminbound(lambda x: dot(x-.5, x-.5), zeros(2), ones(2))
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/lib/python2.4/site-packages/scipy/optimize/optimize.py", line
 1244, in fminbound
     if x1 > x2:
 ValueError: The truth value of an array with more than one element is
 ambiguous. Use a.any() or a.all()
 # 1-dimensional case works:
 >>> optimize.fminbound(lambda x: dot(x-.5,x-.5), zeros(1), ones(1))
 array([ 0.5])
 }}}

 I'm on a Debian testing/unstable system with python 2.4.4, '''numpy
 1.0.3''' and '''scipy 0.6.0''' . I've looked in the svn repository and
 found the line mentioned in the error traceback. So I guess it's not fixed
 already.

 I suggest changing the relevant line as the traceback says.

 Thanks for the great work you've created with scipy/numpy.

 Regards,
     eike

-- 
Ticket URL: <http://scipy.org/scipy/scipy/ticket/544>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list