1515bool HighsImplications::computeImplications (HighsInt col, bool val) {
1616 HighsDomain& globaldomain = mipsolver.mipdata_ ->domain ;
1717 HighsCliqueTable& cliquetable = mipsolver.mipdata_ ->cliquetable ;
18- globaldomain.clearRedundantRows ();
1918 globaldomain.propagate ();
20- if (globaldomain.infeasible () || globaldomain.isFixed (col)) {
21- globaldomain.clearRedundantRows ();
22- return true ;
23- }
19+ if (globaldomain.infeasible () || globaldomain.isFixed (col)) return true ;
20+
21+ // record redundant rows for lifting
22+ assert (globaldomain.getRedundantRows ().size () == 0 );
23+ if (storeLiftingOpportunity != nullptr )
24+ globaldomain.setRecordRedundantRows (true );
2425
2526 const auto & domchgstack = globaldomain.getDomainChangeStack ();
2627 const auto & domchgreason = globaldomain.getDomainChangeReason ();
@@ -33,28 +34,36 @@ bool HighsImplications::computeImplications(HighsInt col, bool val) {
3334 else
3435 globaldomain.changeBound (HighsBoundType::kUpper , col, 0 );
3536
36- auto isInfeasible = [&]() {
37+ auto storeLiftingOpportunities = [&](HighsInt col, double val) {
38+ // use callback to store new lifting opportunities; negate column index if
39+ // variable is set to its lower bound
40+ if (storeLiftingOpportunity != nullptr ) {
41+ for (const auto & elm : globaldomain.getRedundantRows ())
42+ storeLiftingOpportunity (
43+ elm.key (), (val ? 1 : -1 ) * col,
44+ (val ? -1 : 1 ) * globaldomain.getRedundantRowValue (elm.key ()));
45+ globaldomain.clearRedundantRows ();
46+ globaldomain.setRecordRedundantRows (false );
47+ }
48+ };
49+
50+ auto isInfeasible = [&](HighsInt col, double val) {
3751 if (!globaldomain.infeasible ()) return false ;
3852 globaldomain.backtrack ();
3953 globaldomain.clearChangedCols (changedend);
4054 cliquetable.vertexInfeasible (globaldomain, col, val);
41- globaldomain. clearRedundantRows ( );
55+ storeLiftingOpportunities (col, val );
4256 return true ;
4357 };
4458
45- if (isInfeasible ()) return true ;
59+ if (isInfeasible (col, val )) return true ;
4660
4761 globaldomain.propagate ();
4862
49- if (isInfeasible ()) return true ;
63+ if (isInfeasible (col, val )) return true ;
5064
51- // use callback to store new lifting opportunities; negate column index if
52- // variable is set to its lower bound
53- if (storeLiftingOpportunity != nullptr )
54- for (const auto & elm : globaldomain.getRedundantRows ())
55- storeLiftingOpportunity (
56- elm.key (), (val ? 1 : -1 ) * col,
57- (val ? -1 : 1 ) * globaldomain.getRedundantRowValue (elm.key ()));
65+ // inform caller about lifting opportunities
66+ storeLiftingOpportunities (col, val);
5867
5968 HighsInt stackimplicend = domchgstack.size ();
6069 numImplications += stackimplicend;
0 commit comments