From 9b38d66ab39fbd79e6e9a0ce3cce3c439fb7643d Mon Sep 17 00:00:00 2001 From: Oliver Sander <oliver.sander@tu-dresden.de> Date: Tue, 7 Jan 2025 07:32:55 +0100 Subject: [PATCH] IPOpt: Call Infeasibilities with five arguments Starting with IPOpt 3.14 there is an overload of the Infeasibilities method with five arguments. The old one with four arguments still exists, but using it triggers a deprecation warning. Use the new method if the IPOpt version is high enough. --- dune/solvers/solvers/quadraticipopt.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dune/solvers/solvers/quadraticipopt.hh b/dune/solvers/solvers/quadraticipopt.hh index 1e516f02..5b2171bb 100644 --- a/dune/solvers/solvers/quadraticipopt.hh +++ b/dune/solvers/solvers/quadraticipopt.hh @@ -815,11 +815,17 @@ void QuadraticIPOptSolver<MatrixType,VectorType,JacobianType>::solve() else if (status == Ipopt::Search_Direction_Becomes_Too_Small) { Ipopt::Number dual_inf; // dual infeasibility (Gradient of Lagrangian not zero) Ipopt::Number constr_viol; // violation of constraints +#if IPOPT_VERSION_MAJOR>=3 && IPOPT_VERSION_MINOR>=14 + Ipopt::Number varbounds_viol; // violation of variable bounds +#endif Ipopt::Number complementarity; // violation of complementarity Ipopt::Number kkt_error; // KKT error app->Statistics()->Infeasibilities(dual_inf, constr_viol, +#if IPOPT_VERSION_MAJOR>=3 && IPOPT_VERSION_MINOR>=14 + varbounds_viol, +#endif complementarity, kkt_error); -- GitLab