Skip to content

Commit

Permalink
Add safeguard for expansion factor
Browse files Browse the repository at this point in the history
  • Loading branch information
einar90 committed Nov 22, 2016
1 parent 12051c0 commit bb0aa25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion FieldOpt/Optimization/optimizers/GSS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ namespace Optimization {
std::cout << ("WARNING: Compass search does not handle both continuous and discrete variables at the same time");

contr_fac_ = settings->parameters().contraction_factor;
expan_fac_ = settings->parameters().expansion_factor;

if (settings->parameters().expansion_factor >= 1.0)
expan_fac_ = settings->parameters().expansion_factor;
step_tol_ = settings->parameters().minimum_step_length;

assert(step_lengths_.size() == directions_.size());
Expand Down

0 comments on commit bb0aa25

Please sign in to comment.