This commit is contained in:
chriseth 2022-02-03 11:35:06 +01:00
parent cf6cf5bba2
commit 6bff7a1e91

View File

@ -395,6 +395,7 @@ void removeColumns(SolvingState& _state, vector<bool> const& _columnsToRemove)
} }
/// Turn constraints of the form ax <= b into an upper bound on x. /// Turn constraints of the form ax <= b into an upper bound on x.
/// @returns false if the system is infeasible.
bool extractDirectConstraints(SolvingState& _state, bool& _changed) bool extractDirectConstraints(SolvingState& _state, bool& _changed)
{ {
vector<bool> constraintsToRemove(_state.constraints.size(), false); vector<bool> constraintsToRemove(_state.constraints.size(), false);
@ -446,9 +447,10 @@ bool extractDirectConstraints(SolvingState& _state, bool& _changed)
return true; return true;
} }
/// Remove variables that have equal lower and upper bound.
/// @returns false if the system is infeasible.
bool removeFixedVariables(SolvingState& _state, map<string, rational>& _model, bool& _changed) bool removeFixedVariables(SolvingState& _state, map<string, rational>& _model, bool& _changed)
{ {
// Remove variables that have equal lower and upper bound.
for (auto const& [index, bounds]: _state.bounds | ranges::views::enumerate) for (auto const& [index, bounds]: _state.bounds | ranges::views::enumerate)
{ {
if (!bounds.upper || (!bounds.lower && bounds.upper->numerator() > 0)) if (!bounds.upper || (!bounds.lower && bounds.upper->numerator() > 0))