Skip to content

Commit c5e156c

Browse files
authored
Fix the approach used to update mu (#664)
* fix mu update * update example solutions * remove typo
1 parent c6f94d2 commit c5e156c

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/Drivers/MDS/NlpMdsEx1Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ int main(int argc, char **argv)
146146

147147

148148
if(selfCheck) { // && has_empty_sp_row) {
149-
if(fabs(obj_value-(-4.9994888159755632e+01))>1e-6) {
149+
if(fabs(obj_value-(-4.9994906229741609e+01))>1e-6) {
150150
printf("selfcheck: objective mismatch for MDS Ex1 problem with 400 sparse variables and 100 "
151151
"dense variables did. BTW, obj=%18.12e was returned by HiOp.\n", obj_value);
152152
ret_code = -1;

src/Drivers/MDS/NlpMdsEx1RajaDriver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ int main(int argc, char **argv)
160160
obj_value = solver.getObjective();
161161

162162
if(selfCheck && has_empty_sp_row) {
163-
if(fabs(obj_value-(-4.9994888159755632e+01))>1e-6) {
163+
if(fabs(obj_value-(-4.9994906229741609e+01))>1e-6) {
164164
printf("selfcheck: objective mismatch for MDS Ex1 problem with 400 sparse variables and 100 "
165165
"dense variables did. BTW, obj=%18.12e was returned by HiOp.\n", obj_value);
166166
return -1;

src/Optimization/hiopAlgFilterIPM.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,15 +547,17 @@ bool hiopAlgFilterIPMBase::update_log_barrier_params(hiopIterate& it,
547547
double& mu_new,
548548
double& tau_new)
549549
{
550-
double new_mu = fmax(eps_tol/10, fmin(kappa_mu*mu_curr, pow(mu_curr,theta_mu)));
550+
const double target_comp_tol = comp_tol_/nlp->get_obj_scale();
551+
double new_mu = std::fmax(0.0, std::fmin(kappa_mu*mu_curr, std::pow(mu_curr,theta_mu)));
552+
new_mu = std::fmax(new_mu, std::fmin(eps_tol, target_comp_tol)/(10.+1.) );
551553
if(fabs(new_mu-mu_curr)<1e-16) {
552554
return false;
553555
}
554556
mu_new = new_mu;
555557
tau_new = fmax(tau_min,1.0-mu_new);
556558

557559
if(elastic_mode_on) {
558-
const double target_mu = nlp->options->GetNumeric("tolerance");
560+
const double target_mu = eps_tol;
559561
const double bound_relax_perturb_init = nlp->options->GetNumeric("elastic_mode_bound_relax_initial");
560562
const double bound_relax_perturb_min = nlp->options->GetNumeric("elastic_mode_bound_relax_final");
561563
double bound_relax_perturb = bound_relax_perturb_init;

0 commit comments

Comments
 (0)