rearrange_bound_pair_to_triple

(function from pyomo.contrib.pyros.util)

pyomo.contrib.pyros.util.rearrange_bound_pair_to_triple(lower_bound, upper_bound)[source]

Rearrange a lower/upper bound pair into a lower/equality/upper bound triple, according to whether or not the lower and upper bound are identical numerical values or expressions.

Parameters:
Returns:

Lower/equality/upper bound triple. The equality bound is None if lower_bound and upper_bound are not identical numeric type or NumericExpression objects, or else it is set to upper_bound, in which case, both the lower and upper bounds are returned as None.

Return type:

BoundTriple

Note

This method is meant to behave in a manner akin to that of ConstraintData.equality, in which a ranged inequality constraint may be considered an equality constraint if the lower and upper attributes of the constraint are identical and not None.