Skip to content

Commit 6184de1

Browse files
committed
Bug fix: if rho=rhoend during safety step, correctly return xnew if it is an improvement
1 parent 88653a3 commit 6184de1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dfols/solver.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,12 @@ def solve_main(objfun, x0, args, xl, xu, npt, rhobeg, rhoend, maxfun, nruns_so_f
405405
number_of_samples = max(nsamples(control.delta, control.rho, current_iter, nruns_so_far), 1)
406406
rvec_list, f_list, num_samples_run, exit_info = control.evaluate_objective(x, number_of_samples,
407407
params)
408-
if exit_info is not None:
409-
if num_samples_run > 0:
408+
409+
if num_samples_run > 0:
410410
control.model.save_point(x, np.mean(rvec_list[:num_samples_run, :], axis=0),
411411
num_samples_run, x_in_abs_coords=True)
412+
413+
if exit_info is not None:
412414
nruns_so_far += 1
413415
break # quit
414416

0 commit comments

Comments
 (0)