diff --git a/include/mp/flat/constr_2_expr.h b/include/mp/flat/constr_2_expr.h index bcccd2479..25ab7c982 100644 --- a/include/mp/flat/constr_2_expr.h +++ b/include/mp/flat/constr_2_expr.h @@ -353,11 +353,11 @@ class Constraints2Expr { pre::AutoLinkScope auto_link_scope{ *(Impl*)this, obj_src }; if (qobj.GetQPTerms().empty()) exprResVar = MPD( AssignResultVar2Args( - LinearFunctionalConstraint{ {lt_in_expr, 1.0} } ) ); + LinearFunctionalConstraint{ {lt_in_expr, 0.0} } ) ); else // Move QP terms into the expr exprResVar = MPD( AssignResultVar2Args( QuadraticFunctionalConstraint - { {{lt_in_expr, std::move(qobj.GetQPTerms())}, 1.0} } ) ); + { {{lt_in_expr, std::move(qobj.GetQPTerms())}, 0.0} } ) ); MPD( AddInitExprContext(exprResVar, // Context is compulsory obj::MAX==qobj.obj_sense_true() // no need to propagate ? Context::CTX_POS : Context::CTX_NEG) ); diff --git a/include/mp/flat/converter.h b/include/mp/flat/converter.h index a25f551f6..369af7aa9 100644 --- a/include/mp/flat/converter.h +++ b/include/mp/flat/converter.h @@ -273,13 +273,13 @@ class FlatConverter : constr_depth_ = 1; // Workaround. TODO have maps as special constraints MP_DISPATCH( ConvertMaps() ); MP_DISPATCH( PreprocessFlatFinal() ); // final flat model prepro - MP_DISPATCH( ConsiderEmulatingMultiobj() ); if constexpr (IfAcceptingNLOutput()) { if (IfWantNLOutput()) { MPD( Convert2NL() ); MPD( PreprocessNLFinal() ); } } + MP_DISPATCH( ConsiderEmulatingMultiobj() ); // After NL conversion } catch (const ConstraintConversionFailure& cff) { MP_RAISE(cff.message()); }