@@ -686,9 +686,8 @@ bool hiopAlgFilterIPMBase::evalNlpAndLogErrors(const hiopIterate& it,
686
686
}
687
687
688
688
// scaling factors
689
- // double sd = fmax(p_smax, (nrmDualBou + nrmDualEqu) / (n + m)) / p_smax;
690
- // double sc = n == 0 ? 0 : fmax(p_smax, nrmDualBou / n) / p_smax;
691
-
689
+ // c double sd = fmax(p_smax, (nrmDualBou + nrmDualEqu) / (n + m)) / p_smax;
690
+ // c double sc = n == 0 ? 0 : fmax(p_smax, nrmDualBou / n) / p_smax;
692
691
sd = fmax (p_smax, sd) / p_smax;
693
692
sc = n == 0 ? 0 : fmax (p_smax, sc) / p_smax;
694
693
@@ -720,98 +719,98 @@ bool hiopAlgFilterIPMBase::evalNlpAndLogErrors(const hiopIterate& it,
720
719
return true ;
721
720
}
722
721
723
- bool hiopAlgFilterIPMBase::evalNlpAndLogErrors2 (const hiopIterate& it,
724
- const hiopResidual& resid,
725
- const double & mu,
726
- double & nlpoptim,
727
- double & nlpfeas,
728
- double & nlpcomplem,
729
- double & nlpoverall,
730
- double & logoptim,
731
- double & logfeas,
732
- double & logcomplem,
733
- double & logoverall,
734
- double & cons_violation)
735
- {
736
- nlp->runStats .tmSolverInternal .start ();
737
-
738
- size_type n = nlp->n_complem ();
739
- double sc;
740
- double sd;
741
- double nrmDualBou;
742
- double nrmDualEqu;
743
- if (!it.compute_sc_sd (sc, sd, nrmDualEqu, nrmDualBou)) {
744
- return false ;
745
- }
746
-
747
- nlp->log ->printf (hovWarning, " nrmOneDualEqu %g nrmOneDualBo %g\n " , nrmDualEqu, nrmDualBou);
748
- if (nrmDualBou > 1e+10 ) {
749
- nlp->log ->printf (hovWarning,
750
- " Unusually large bound dual variables (norm1=%g) occured, "
751
- " which may cause numerical instabilities if it persists. Convergence "
752
- " issues or inacurate optimal solutions may be experienced. Possible causes: "
753
- " tight bounds or bad scaling of the optimization variables.\n " ,
754
- nrmDualBou);
755
- if (nlp->options ->GetString (" fixed_var" ) == " remove" ) {
756
- nlp->log ->printf (hovWarning,
757
- " For example, increase 'fixed_var_tolerance' to remove "
758
- " additional variables.\n " );
759
- } else if (nlp->options ->GetString (" fixed_var" ) == " relax" ) {
760
- nlp->log ->printf (hovWarning,
761
- " For example, increase 'fixed_var_tolerance' to relax "
762
- " aditional (tight) variables and/or increase 'fixed_var_perturb' "
763
- " to decrease the tightness.\n " );
764
- } else {
765
- nlp->log ->printf (hovWarning,
766
- " Potential fixes: fix or relax variables with tight bounds "
767
- " (see 'fixed_var' option) or rescale variables.\n " );
768
- }
769
- }
770
-
771
- // scaling factors
772
- // sd = max { p_smax, ||zl||_M + ||zu||_M + (||vl||_1 + ||vu||_1)/m } /p_smax
773
- // sc = max { p_smax, ||zl||_M + ||zu||_M } /p_smax
774
- // nlpoptim = ||gradf + Jc'*yc + Jd'*Jd - M*zl - M*zu||_Hinv
775
- // ||yd+vl-vu||_inf
776
- // nlpfeas = ||crhs- c||_inf
777
- // ||drs- d||_inf
778
- // ||x-sxl-xl||_inf
779
- // ||x-sxu+xu||_inf
780
- // ||d-sdl-dl||
781
- //
782
- // double sd = fmax(p_smax, (nrmDualBou + nrmDualEqu) / (n + m)) / p_smax;
783
- // double sc = n == 0 ? 0 : fmax(p_smax, nrmDualBou / n) / p_smax;
784
-
785
- sd = fmax (p_smax, sd) / p_smax;
786
- sc = n == 0 ? 0 : fmax (p_smax, sc) / p_smax;
787
-
788
- sd = fmin (sd, 1e+8 );
789
- sc = fmin (sc, 1e+8 );
790
-
791
- // actual nlp errors
792
- resid.getNlpErrors (nlpoptim, nlpfeas, nlpcomplem, cons_violation);
793
-
794
- // finally, the scaled nlp error
795
- nlpoverall = fmax (nlpoptim / sd, fmax (cons_violation, nlpcomplem / sc));
796
-
797
- nlp->log ->printf (hovWarning,
798
- " nlpoverall %g nloptim %g sd %g nlpfeas %g nlpcomplem %g sc %g cons_violation %g\n " ,
799
- nlpoverall,
800
- nlpoptim,
801
- sd,
802
- nlpfeas,
803
- nlpcomplem,
804
- cons_violation,
805
- sc);
806
-
807
- // actual log errors
808
- resid.getBarrierErrors (logoptim, logfeas, logcomplem);
809
-
810
- // finally, the scaled barrier error
811
- logoverall = fmax (logoptim / sd, fmax (cons_violation, logcomplem / sc));
812
- nlp->runStats .tmSolverInternal .stop ();
813
- return true ;
814
- }
722
+ // bool hiopAlgFilterIPMBase::evalNlpAndLogErrors2(const hiopIterate& it,
723
+ // const hiopResidual& resid,
724
+ // const double& mu,
725
+ // double& nlpoptim,
726
+ // double& nlpfeas,
727
+ // double& nlpcomplem,
728
+ // double& nlpoverall,
729
+ // double& logoptim,
730
+ // double& logfeas,
731
+ // double& logcomplem,
732
+ // double& logoverall,
733
+ // double& cons_violation)
734
+ // {
735
+ // nlp->runStats.tmSolverInternal.start();
736
+
737
+ // size_type n = nlp->n_complem();
738
+ // double sc;
739
+ // double sd;
740
+ // double nrmDualBou;
741
+ // double nrmDualEqu;
742
+ // if(!it.compute_sc_sd(sc, sd, nrmDualEqu, nrmDualBou)) {
743
+ // return false;
744
+ // }
745
+
746
+ // nlp->log->printf(hovWarning, "nrmOneDualEqu %g nrmOneDualBo %g\n", nrmDualEqu, nrmDualBou);
747
+ // if(nrmDualBou > 1e+10) {
748
+ // nlp->log->printf(hovWarning,
749
+ // "Unusually large bound dual variables (norm1=%g) occured, "
750
+ // "which may cause numerical instabilities if it persists. Convergence "
751
+ // " issues or inacurate optimal solutions may be experienced. Possible causes: "
752
+ // " tight bounds or bad scaling of the optimization variables.\n",
753
+ // nrmDualBou);
754
+ // if(nlp->options->GetString("fixed_var") == "remove") {
755
+ // nlp->log->printf(hovWarning,
756
+ // "For example, increase 'fixed_var_tolerance' to remove "
757
+ // "additional variables.\n");
758
+ // } else if(nlp->options->GetString("fixed_var") == "relax") {
759
+ // nlp->log->printf(hovWarning,
760
+ // "For example, increase 'fixed_var_tolerance' to relax "
761
+ // "aditional (tight) variables and/or increase 'fixed_var_perturb' "
762
+ // "to decrease the tightness.\n");
763
+ // } else {
764
+ // nlp->log->printf(hovWarning,
765
+ // "Potential fixes: fix or relax variables with tight bounds "
766
+ // "(see 'fixed_var' option) or rescale variables.\n");
767
+ // }
768
+ // }
769
+
770
+ // // scaling factors
771
+ // //sd = max { p_smax, ||zl||_M + ||zu||_M + (||vl||_1 + ||vu||_1)/m } /p_smax
772
+ // //sc = max { p_smax, ||zl||_M + ||zu||_M } /p_smax
773
+ // //nlpoptim = ||gradf + Jc'*yc + Jd'*Jd - M*zl - M*zu||_Hinv
774
+ // // ||yd+vl-vu||_inf
775
+ // //nlpfeas = ||crhs- c||_inf
776
+ // // ||drs- d||_inf
777
+ // // ||x-sxl-xl||_inf
778
+ // // ||x-sxu+xu||_inf
779
+ // // ||d-sdl-dl||
780
+ // //
781
+ // //double sd = fmax(p_smax, (nrmDualBou + nrmDualEqu) / (n + m)) / p_smax;
782
+ // //double sc = n == 0 ? 0 : fmax(p_smax, nrmDualBou / n) / p_smax;
783
+
784
+ // sd = fmax(p_smax, sd) / p_smax;
785
+ // sc = n == 0 ? 0 : fmax(p_smax, sc) / p_smax;
786
+
787
+ // sd = fmin(sd, 1e+8);
788
+ // sc = fmin(sc, 1e+8);
789
+
790
+ // // actual nlp errors
791
+ // resid.getNlpErrors(nlpoptim, nlpfeas, nlpcomplem, cons_violation);
792
+
793
+ // // finally, the scaled nlp error
794
+ // nlpoverall = fmax(nlpoptim / sd, fmax(cons_violation, nlpcomplem / sc));
795
+
796
+ // nlp->log->printf(hovWarning,
797
+ // "nlpoverall %g nloptim %g sd %g nlpfeas %g nlpcomplem %g sc %g cons_violation %g\n",
798
+ // nlpoverall,
799
+ // nlpoptim,
800
+ // sd,
801
+ // nlpfeas,
802
+ // nlpcomplem,
803
+ // cons_violation,
804
+ // sc);
805
+
806
+ // // actual log errors
807
+ // resid.getBarrierErrors(logoptim, logfeas, logcomplem);
808
+
809
+ // // finally, the scaled barrier error
810
+ // logoverall = fmax(logoptim / sd, fmax(cons_violation, logcomplem / sc));
811
+ // nlp->runStats.tmSolverInternal.stop();
812
+ // return true;
813
+ // }
815
814
816
815
bool hiopAlgFilterIPMBase::evalNlp_funcOnly (hiopIterate& iter, double & f, hiopVector& c, hiopVector& d)
817
816
{
@@ -1169,7 +1168,7 @@ hiopSolveStatus hiopAlgFilterIPMQuasiNewton::run()
1169
1168
solver_status_ = NlpSolve_Pending;
1170
1169
1171
1170
while (true ) {
1172
- bret = evalNlpAndLogErrors2 (*it_curr,
1171
+ bret = evalNlpAndLogErrors (*it_curr,
1173
1172
*resid,
1174
1173
_mu,
1175
1174
_err_nlp_optim,
@@ -1262,7 +1261,7 @@ hiopSolveStatus hiopAlgFilterIPMQuasiNewton::run()
1262
1261
1263
1262
// ! should perform only a partial update since NLP didn't change
1264
1263
resid->update (*it_curr, _f_nlp, *_c, *_d, *_grad_f, *_Jac_c, *_Jac_d, *logbar);
1265
- bret = evalNlpAndLogErrors2 (*it_curr,
1264
+ bret = evalNlpAndLogErrors (*it_curr,
1266
1265
*resid,
1267
1266
_mu,
1268
1267
_err_nlp_optim,
0 commit comments