[SciPy-user] Bug(?) in optimize.fmin_ncg

Nils Wagner nwagner at mecha.uni-stuttgart.de
Wed Jun 29 10:22:37 CDT 2005

Hi all,

I have obtained a runtime error depending on the order n. The test 
program is attached.

It works fine for n = 10

Optimization terminated successfully.
         Current function value: 0.022338
         Iterations: 7
         Function evaluations: 8
         Gradient evaluations: 69
         Hessian evaluations: 0
fmin_ncg 8
Approximated smallest eigenvalue 0.0223383475497
smallest eigenvalue by linalg.eigvals 0.0223383475497

Any idea how to fix this problem would be appreciated.

Thanks in advance.


 numerix Numeric 24.0b2
Traceback (most recent call last):
  File "ncg.py", line 25, in ?
    xopt4 = optimize.fmin_ncg(func,x0, fprime)
  File "/usr/lib/python2.3/site-packages/scipy/optimize/optimize.py", 
line 978, in fmin_ncg
    xsupi = xsupi + dri0/curv * psupi
ZeroDivisionError: float division

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ncg.py
Type: text/x-python
Size: 771 bytes
Desc: not available
Url : http://www.scipy.net/pipermail/scipy-user/attachments/20050629/bc516e5e/ncg.py

More information about the SciPy-user mailing list