coin-or / MibS

A solver for mixed integer bilevel programs
Eclipse Public License 1.0
50 stars 20 forks source link

Read range constraints (continue): remove redundant condition check and fix bugs #113

Closed yuxies closed 1 year ago

yuxies commented 1 year ago

Fixed some minor bugs. No (substantive) changes to read/write functions.

  1. removed a redundant condition check for equality/range constraints (though I think C++ is using a short circuit logic so it may not be that redundant?);
  2. added break to findIndex() so it terminates once the target is found;
  3. added comments for reference.
yuxies commented 1 year ago

The problem in the Slack chat was caused by unmatched column numbers in the .mps and .aux files. In debug mode, the error could be detected by the assert here. But I am not sure if we need to add a barricade to explicitly throw the error before any memory bug happens.