diff --git a/src/presolve/HighsPostsolveStack.h b/src/presolve/HighsPostsolveStack.h index f479d7f0dd..5fdfa5e81d 100644 --- a/src/presolve/HighsPostsolveStack.h +++ b/src/presolve/HighsPostsolveStack.h @@ -27,8 +27,8 @@ #include "lp_data/HighsOptions.h" #include "util/HighsCDouble.h" #include "util/HighsDataStack.h" -#include "util/HighsMatrixSlice.h" #include "util/HighsExceptions.h" +#include "util/HighsMatrixSlice.h" // class HighsOptions; namespace presolve { @@ -373,22 +373,23 @@ class HighsPostsolveStack { template void fixedColAtLower(HighsInt col, double fixValue, double colCost, const HighsMatrixSlice& colVec) { - try { - assert(std::isfinite(fixValue)); - colValues.clear(); - for (const HighsSliceNonzero& colVal : colVec) + assert(std::isfinite(fixValue)); + colValues.clear(); + for (const HighsSliceNonzero& colVal : colVec) { + try { colValues.emplace_back(origRowIndex[colVal.index()], colVal.value()); - - reductionValues.push(FixedCol{fixValue, colCost, origColIndex[col], - HighsBasisStatus::kLower}); - reductionValues.push(colValues); - reductionAdded(ReductionType::kFixedCol); - } catch (const DataStackOverflow& e) { - std::cerr << "Memory allocation failed while processing fixedColAtLower: " - << std::endl; - // Rethrow. - throw; + } catch (const DataStackOverflow& e) { + std::cerr + << "Memory allocation failed while processing fixedColAtLower: " + << std::endl; + // Rethrow. + throw; + } } + reductionValues.push(FixedCol{fixValue, colCost, origColIndex[col], + HighsBasisStatus::kLower}); + reductionValues.push(colValues); + reductionAdded(ReductionType::kFixedCol); } template void fixedColAtUpper(HighsInt col, double fixValue, double colCost, diff --git a/src/util/HighsDataStack.h b/src/util/HighsDataStack.h index c647273ea1..b52c11251f 100644 --- a/src/util/HighsDataStack.h +++ b/src/util/HighsDataStack.h @@ -47,7 +47,7 @@ class HighsDataStack { throw DataStackOverflow( "Failed to resize the vector. Requested new size: " + std::to_string(newSize) + ". Size to add is " + - std::to_string(sizeof(T)) + "for "+ + std::to_string(sizeof(T)) + ". Current size: " + std::to_string(data.size()) + "."); } std::memcpy(data.data() + dataSize, &r, sizeof(T));