File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,8 +181,15 @@ namespace linspire
181181 assert (x < vars.size ());
182182 assert (v > utils::rational::negative_infinite);
183183 LOG_TRACE (" x" << std::to_string (x) << " = " << utils::to_string (val (x)) << " [" << utils::to_string (lb (x)) << " -> " << utils::to_string (v) << " , " << utils::to_string (ub (x)) << " ]" );
184- if (v > ub (x)) // inconsistent bound..
184+ if (v > ub (x))
185+ { // inconsistent bound..
186+ cnfl.clear ();
187+ if (reason)
188+ cnfl.push_back (reason);
189+ for (const auto &w : vars.at (x).ubs .begin ()->second ) // we use the most restrictive upper bound of x
190+ cnfl.push_back (w);
185191 return false ;
192+ }
186193 if (reason)
187194 { // we have a reason for this bound..
188195 if (auto it = reason->lbs .find (x); it != reason->lbs .end ())
@@ -206,8 +213,15 @@ namespace linspire
206213 assert (x < vars.size ());
207214 assert (v < utils::rational::positive_infinite);
208215 LOG_TRACE (" x" << std::to_string (x) << " = " << utils::to_string (val (x)) << " [" << utils::to_string (lb (x)) << " , " << utils::to_string (v) << " <- " << utils::to_string (ub (x)) << " ]" );
209- if (v < lb (x)) // inconsistent bound..
216+ if (v < lb (x))
217+ { // inconsistent bound..
218+ cnfl.clear ();
219+ if (reason)
220+ cnfl.push_back (reason);
221+ for (const auto &w : vars.at (x).lbs .rbegin ()->second ) // we use the most restrictive lower bound of x
222+ cnfl.push_back (w);
210223 return false ;
224+ }
211225 if (reason)
212226 { // we have a reason for this bound..
213227 if (auto it = reason->ubs .find (x); it != reason->ubs .end ())
You can’t perform that action at this time.
0 commit comments