Browse Source

glpk: Fixed pop()ing for the case where no constraints have to be deleted.

tempestpy_adaptions
Tim Quatmann 5 years ago
parent
commit
3881ae73f2
  1. 2
      src/storm/solver/GlpkLpSolver.cpp

2
src/storm/solver/GlpkLpSolver.cpp

@ -430,7 +430,9 @@ namespace storm {
IncrementalLevel const& lvl = incrementalData.back(); IncrementalLevel const& lvl = incrementalData.back();
// Since glpk uses 1-based indexing, we need to prepend an additional index // Since glpk uses 1-based indexing, we need to prepend an additional index
std::vector<int> indicesToBeRemoved = storm::utility::vector::buildVectorForRange(lvl.firstConstraintIndex - 1, glp_get_num_rows(this->lp) + 1); std::vector<int> indicesToBeRemoved = storm::utility::vector::buildVectorForRange(lvl.firstConstraintIndex - 1, glp_get_num_rows(this->lp) + 1);
if (indicesToBeRemoved.size() > 1) {
glp_del_rows(this->lp, indicesToBeRemoved.size() - 1, indicesToBeRemoved.data()); glp_del_rows(this->lp, indicesToBeRemoved.size() - 1, indicesToBeRemoved.data());
}
indicesToBeRemoved.clear(); indicesToBeRemoved.clear();
if (!lvl.variables.empty()) { if (!lvl.variables.empty()) {

Loading…
Cancel
Save