ConstraintToVarBoundTransform

(class from pyomo.contrib.preprocessing.plugins.bounds_to_vars)

class pyomo.contrib.preprocessing.plugins.bounds_to_vars.ConstraintToVarBoundTransform(**kwds)[source]

Bases: IsomorphicTransformation

Change constraints to be a bound on the variable.

Looks for constraints of form: \(k*v + c_1 \leq c_2\). Changes variable lower bound on \(v\) to match \((c_2 - c_1)/k\) if it results in a tighter bound. Also does the same thing for lower bounds.

Keyword arguments below are specified for the apply_to and create_using functions.

Keyword Arguments:
  • tolerance (NonNegativeFloat, default=1e-13) – tolerance on bound equality (\(LB = UB\))

  • detect_fixed (bool, default=True) – If True, fix variable when \(| LB - UB | \leq tolerance\).

__init__(**kwds)

Methods

__init__(**kwds)

apply(model, **kwds)

DEPRECATED.

apply_to(model, **kwds)

Apply the transformation to the given model.

create_using(model, **kwds)

Create a new model with this transformation

Attributes

CONFIG

Member Documentation

apply(model, **kwds)

DEPRECATED.

Deprecated since version 4.3.11323: Transformation.apply() has been deprecated. Please use either Transformation.apply_to() for in-place transformations or Transformation.create_using() for transformations that create a new, independent transformed model instance.

apply_to(model, **kwds)

Apply the transformation to the given model.

create_using(model, **kwds)

Create a new model with this transformation