From eb38ec2ca1b87ab503b35c9f99d1ae790aec6710 Mon Sep 17 00:00:00 2001 From: Gleb Belov Date: Mon, 30 Oct 2023 18:18:45 +1100 Subject: [PATCH] Again some more UEnc Do it when N different values in comparisons > 1/3 card(domain) --- include/mp/flat/redef/MIP/converter_mip.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/mp/flat/redef/MIP/converter_mip.h b/include/mp/flat/redef/MIP/converter_mip.h index d40e61482..30ea2e8f8 100644 --- a/include/mp/flat/redef/MIP/converter_mip.h +++ b/include/mp/flat/redef/MIP/converter_mip.h @@ -264,7 +264,10 @@ class MIPFlatConverter return false; } - bool DontNeedEqEncForVar(int , const SingleVarEqConstMap& map) { + bool DontNeedEqEncForVar(int var, const SingleVarEqConstMap& map) { + if (3 * map.size() // Use UEnc if we have >1/3 of the domain values + > MPCD(ub(var))-MPCD(lb(var))) + return false; int nNegCtx = 0; const auto& ck = GET_CONSTRAINT_KEEPER(CondLinConEQ); for (const auto& el: map) {