Changeset 559 for branches


Ignore:
Timestamp:
09/12/12 11:40:33 (4 years ago)
Author:
mmckerns
Message:

fmin_powell with full_output return more standard (moved direc to end)

Location:
branches
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HPCtut/optimize_helper.py

    r534 r559  
    1111                                         disp=disp, itermon=mon, handler=0) 
    1212    # return: solution, energy, generations, fevals 
    13     return solved[0], solved[1], solved[3], solved[4] 
     13    return solved[0], solved[1], solved[2], solved[3] 
    1414 
    1515def diffev(cost, x0, full=1, disp=1, monitor=0): 
     
    2323                                         disp=disp, itermon=mon, handler=0) 
    2424    # return: solution, energy, generations, fevals 
    25     return solved[0], solved[1], solved[3], solved[4] 
     25    return solved[0], solved[1], solved[2], solved[3] 
    2626 
    2727 
  • branches/UQ/math/legacy/dirac_measure.py

    r558 r559  
    10221022  if debug: stepmon = VerboseMonitor(10)  #!!! 
    10231023  if npop: # use VTR 
    1024     _i = 2 #XXX: iter returned as results[2] 
    10251024    results = diffev2(cost, guess, npop, ftol=ftol, gtol=gtol, bounds=bounds,\ 
    10261025                      maxiter=maxiter, maxfun=maxfun, constraints=constraints,\ 
     
    10291028                      full_output=1, disp=0, handler=False) 
    10301029  else: # use VTR 
    1031     _i = 3 #XXX: iter returned as results[3]  (results[2] == direc) 
    10321030    results = fmin_powell(cost, guess, ftol=ftol, gtol=gtol, bounds=bounds,\ 
    10331031                      maxiter=maxiter, maxfun=maxfun, constraints=constraints,\ 
     
    10371035  pm = scenario() 
    10381036  pm.load(results[0], pts)            # params: w,x,y 
    1039   if debug: print "final cost: %s" % results[1] 
    1040   if debug and results[_i] >= maxiter: # iterations 
     1037 #if debug: print "final cost: %s" % results[1] 
     1038  if debug and results[2] >= maxiter: # iterations 
    10411039    print "Warning: constraints solver terminated at maximum iterations" 
    1042  #func_evals = results[_i+1]           # evaluation 
     1040 #func_evals = results[3]           # evaluation 
    10431041  return pm 
    10441042 
     
    11541152  if debug: stepmon = VerboseMonitor(2)  #!!! 
    11551153  if npop: # use VTR 
    1156     _i = 2 #XXX: iter returned as results[2] 
    11571154    results = diffev2(cost, guess, npop, ftol=ftol, gtol=gtol, bounds=bounds,\ 
    11581155                      maxiter=maxiter, maxfun=maxfun, constraints=constraints,\ 
     
    11611158                      full_output=1, disp=0, handler=False) 
    11621159  else: # use VTR 
    1163     _i = 3 #XXX: iter returned as results[3]  (results[2] == direc) 
    11641160    results = fmin_powell(cost, guess, ftol=ftol, gtol=gtol, bounds=bounds,\ 
    11651161                      maxiter=maxiter, maxfun=maxfun, constraints=constraints,\ 
     
    11701166  pm.load(results[0], pts)            # params: w,x,y 
    11711167 #if debug: print "final cost: %s" % results[1] 
    1172   if debug and results[_i] >= maxiter: # iterations 
     1168  if debug and results[2] >= maxiter: # iterations 
    11731169    print "Warning: constraints solver terminated at maximum iterations" 
    1174  #func_evals = results[_i+1]           # evaluation 
     1170 #func_evals = results[3]           # evaluation 
    11751171  return pm 
    11761172 
Note: See TracChangeset for help on using the changeset viewer.