From 3881ae73f2ea70090eb5373b2431b36b9236d5f6 Mon Sep 17 00:00:00 2001 From: Tim Quatmann Date: Wed, 6 Nov 2019 15:24:19 +0100 Subject: [PATCH] glpk: Fixed pop()ing for the case where no constraints have to be deleted. --- src/storm/solver/GlpkLpSolver.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/storm/solver/GlpkLpSolver.cpp b/src/storm/solver/GlpkLpSolver.cpp index 68a34e57a..170d55a78 100644 --- a/src/storm/solver/GlpkLpSolver.cpp +++ b/src/storm/solver/GlpkLpSolver.cpp @@ -430,7 +430,9 @@ namespace storm { IncrementalLevel const& lvl = incrementalData.back(); // Since glpk uses 1-based indexing, we need to prepend an additional index std::vector indicesToBeRemoved = storm::utility::vector::buildVectorForRange(lvl.firstConstraintIndex - 1, glp_get_num_rows(this->lp) + 1); - glp_del_rows(this->lp, indicesToBeRemoved.size() - 1, indicesToBeRemoved.data()); + if (indicesToBeRemoved.size() > 1) { + glp_del_rows(this->lp, indicesToBeRemoved.size() - 1, indicesToBeRemoved.data()); + } indicesToBeRemoved.clear(); if (!lvl.variables.empty()) {