Skip to content

Commit

Permalink
Fix the approach used to update mu (#664)
Browse files Browse the repository at this point in the history
* fix mu update

* update example solutions

* remove typo
  • Loading branch information
nychiang authored Oct 13, 2023
1 parent c6f94d2 commit c5e156c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Drivers/MDS/NlpMdsEx1Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ int main(int argc, char **argv)


if(selfCheck) { // && has_empty_sp_row) {
if(fabs(obj_value-(-4.9994888159755632e+01))>1e-6) {
if(fabs(obj_value-(-4.9994906229741609e+01))>1e-6) {
printf("selfcheck: objective mismatch for MDS Ex1 problem with 400 sparse variables and 100 "
"dense variables did. BTW, obj=%18.12e was returned by HiOp.\n", obj_value);
ret_code = -1;
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/MDS/NlpMdsEx1RajaDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ int main(int argc, char **argv)
obj_value = solver.getObjective();

if(selfCheck && has_empty_sp_row) {
if(fabs(obj_value-(-4.9994888159755632e+01))>1e-6) {
if(fabs(obj_value-(-4.9994906229741609e+01))>1e-6) {
printf("selfcheck: objective mismatch for MDS Ex1 problem with 400 sparse variables and 100 "
"dense variables did. BTW, obj=%18.12e was returned by HiOp.\n", obj_value);
return -1;
Expand Down
6 changes: 4 additions & 2 deletions src/Optimization/hiopAlgFilterIPM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,15 +547,17 @@ bool hiopAlgFilterIPMBase::update_log_barrier_params(hiopIterate& it,
double& mu_new,
double& tau_new)
{
double new_mu = fmax(eps_tol/10, fmin(kappa_mu*mu_curr, pow(mu_curr,theta_mu)));
const double target_comp_tol = comp_tol_/nlp->get_obj_scale();
double new_mu = std::fmax(0.0, std::fmin(kappa_mu*mu_curr, std::pow(mu_curr,theta_mu)));
new_mu = std::fmax(new_mu, std::fmin(eps_tol, target_comp_tol)/(10.+1.) );
if(fabs(new_mu-mu_curr)<1e-16) {
return false;
}
mu_new = new_mu;
tau_new = fmax(tau_min,1.0-mu_new);

if(elastic_mode_on) {
const double target_mu = nlp->options->GetNumeric("tolerance");
const double target_mu = eps_tol;
const double bound_relax_perturb_init = nlp->options->GetNumeric("elastic_mode_bound_relax_initial");
const double bound_relax_perturb_min = nlp->options->GetNumeric("elastic_mode_bound_relax_final");
double bound_relax_perturb = bound_relax_perturb_init;
Expand Down

0 comments on commit c5e156c

Please sign in to comment.