Skip to content

Commit

Permalink
fmin_cg little fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rc committed Apr 24, 2006
1 parent d4461fb commit 42e0b5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/optimize/optimize.py
Expand Up @@ -776,9 +776,9 @@ def fmin_cg(f, x0, fprime=None, args=(), gtol=1e-5, norm=Inf, epsilon=_epsilon,
linesearch.line_search(f,myfprime,xk,pk,gfk,old_fval,
old_old_fval,c2=0.4)
if alpha_k is None: # line search failed -- use different one.
alpha_k, fc, gc, old_fval_backup, old_old_fval_backup, gfkp1 = \
alpha_k, fc, gc, old_fval, old_old_fval, gfkp1 = \
line_search(f,myfprime,xk,pk,gfk,
old_fval,old_old_fval)
old_fval_backup,old_old_fval_backup)
if alpha_k is None or alpha_k == 0:
# This line search also failed to find a better solution.
warnflag = 2
Expand Down

0 comments on commit 42e0b5d

Please sign in to comment.