- Timestamp:
- 09/12/12 11:40:33 (4 years ago)
- Location:
- branches
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HPCtut/optimize_helper.py
r534 r559 11 11 disp=disp, itermon=mon, handler=0) 12 12 # 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] 14 14 15 15 def diffev(cost, x0, full=1, disp=1, monitor=0): … … 23 23 disp=disp, itermon=mon, handler=0) 24 24 # 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] 26 26 27 27 -
branches/UQ/math/legacy/dirac_measure.py
r558 r559 1022 1022 if debug: stepmon = VerboseMonitor(10) #!!! 1023 1023 if npop: # use VTR 1024 _i = 2 #XXX: iter returned as results[2]1025 1024 results = diffev2(cost, guess, npop, ftol=ftol, gtol=gtol, bounds=bounds,\ 1026 1025 maxiter=maxiter, maxfun=maxfun, constraints=constraints,\ … … 1029 1028 full_output=1, disp=0, handler=False) 1030 1029 else: # use VTR 1031 _i = 3 #XXX: iter returned as results[3] (results[2] == direc)1032 1030 results = fmin_powell(cost, guess, ftol=ftol, gtol=gtol, bounds=bounds,\ 1033 1031 maxiter=maxiter, maxfun=maxfun, constraints=constraints,\ … … 1037 1035 pm = scenario() 1038 1036 pm.load(results[0], pts) # params: w,x,y 1039 1040 if debug and results[ _i] >= maxiter: # iterations1037 #if debug: print "final cost: %s" % results[1] 1038 if debug and results[2] >= maxiter: # iterations 1041 1039 print "Warning: constraints solver terminated at maximum iterations" 1042 #func_evals = results[ _i+1] # evaluation1040 #func_evals = results[3] # evaluation 1043 1041 return pm 1044 1042 … … 1154 1152 if debug: stepmon = VerboseMonitor(2) #!!! 1155 1153 if npop: # use VTR 1156 _i = 2 #XXX: iter returned as results[2]1157 1154 results = diffev2(cost, guess, npop, ftol=ftol, gtol=gtol, bounds=bounds,\ 1158 1155 maxiter=maxiter, maxfun=maxfun, constraints=constraints,\ … … 1161 1158 full_output=1, disp=0, handler=False) 1162 1159 else: # use VTR 1163 _i = 3 #XXX: iter returned as results[3] (results[2] == direc)1164 1160 results = fmin_powell(cost, guess, ftol=ftol, gtol=gtol, bounds=bounds,\ 1165 1161 maxiter=maxiter, maxfun=maxfun, constraints=constraints,\ … … 1170 1166 pm.load(results[0], pts) # params: w,x,y 1171 1167 #if debug: print "final cost: %s" % results[1] 1172 if debug and results[ _i] >= maxiter: # iterations1168 if debug and results[2] >= maxiter: # iterations 1173 1169 print "Warning: constraints solver terminated at maximum iterations" 1174 #func_evals = results[ _i+1] # evaluation1170 #func_evals = results[3] # evaluation 1175 1171 return pm 1176 1172
Note: See TracChangeset
for help on using the changeset viewer.