From e6c67924b07eaf9a98c7b2c7178be726795e9c30 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 2 Feb 2022 17:09:50 +0100 Subject: [PATCH] Fix compiler warning. --- libsolutil/LP.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libsolutil/LP.cpp b/libsolutil/LP.cpp index 53aa269e3..9df17f47f 100644 --- a/libsolutil/LP.cpp +++ b/libsolutil/LP.cpp @@ -318,7 +318,8 @@ bool boundsToConstraints(SolvingState& _state) return false; if (*bounds.lower == *bounds.upper) { - vector c(columns); + LinearExpression c; + c.resize(columns); c[0] = *bounds.lower; c[index] = bigint(1); _state.constraints.emplace_back(Constraint{move(c), true}); @@ -327,14 +328,16 @@ bool boundsToConstraints(SolvingState& _state) } if (bounds.lower && *bounds.lower > 0) { - vector c(columns); + LinearExpression c; + c.resize(columns); c[0] = -*bounds.lower; c[index] = bigint(-1); _state.constraints.emplace_back(Constraint{move(c), false}); } if (bounds.upper) { - vector c(columns); + LinearExpression c; + c.resize(columns); c[0] = *bounds.upper; c[index] = bigint(1); _state.constraints.emplace_back(Constraint{move(c), false});