From 00478d9194c3fb3345523e27365e7c4638884e59 Mon Sep 17 00:00:00 2001 From: Gleb Belov Date: Tue, 8 Oct 2024 03:56:12 +1100 Subject: [PATCH] Add missing returns --- include/mp/flat/constr_2_expr.h | 11 ++++++----- solvers/gurobi/gurobibackend.cc | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/mp/flat/constr_2_expr.h b/include/mp/flat/constr_2_expr.h index efcbc3124..3e7068f24 100644 --- a/include/mp/flat/constr_2_expr.h +++ b/include/mp/flat/constr_2_expr.h @@ -156,6 +156,7 @@ class Constraints2Expr { if (2==stage_cvt2expr_) { return ConsiderExplicifyingAlgebraic(con, i); } + return false; } /// Special handling for LinearFunctionalConstraint @@ -165,6 +166,7 @@ class Constraints2Expr { if (2==stage_cvt2expr_) { return ConsiderExplicifyingAlgebraic(con, i); } + return false; } /// Convert complementarity constraint for use with expressions. @@ -690,12 +692,11 @@ class Constraints2Expr { || HasExpressionArgs(con.GetArguments())) { DoExplicify(con, i); // as other explicified expressions return false; - } else { - auto& ck = GET_CONSTRAINT_KEEPER(AlgFuncCon); - const auto& ie = MPD( GetInitExpression(con.GetResultVar()) ); - ck.ConvertConstraint(ie.GetIndex()); - return true; } + auto& ck = GET_CONSTRAINT_KEEPER(AlgFuncCon); + const auto& ie = MPD( GetInitExpression(con.GetResultVar()) ); + ck.ConvertConstraint(ie.GetIndex()); + return true; } } diff --git a/solvers/gurobi/gurobibackend.cc b/solvers/gurobi/gurobibackend.cc index 9070b615f..af1a048db 100644 --- a/solvers/gurobi/gurobibackend.cc +++ b/solvers/gurobi/gurobibackend.cc @@ -981,7 +981,9 @@ int GurobiBackend::GurobiSetFuncConAttributes( case GRB_GENCONSTR_SIN: case GRB_GENCONSTR_TAN: case GRB_GENCONSTR_LOGISTIC: +#ifdef GRB_GENCONSTR_NL case GRB_GENCONSTR_NL: +#endif // GRB_GENCONSTR_NL GrbSetAttrElement(attr, i, vals[i]); if (i_first<0) i_first=i;