mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
cleanup
This commit is contained in:
parent
cf6cf5bba2
commit
6bff7a1e91
@ -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))
|
||||||
|
Loading…
Reference in New Issue
Block a user