Skip to content

Vectorized bounds on variables #2944

@hdavid16

Description

@hdavid16

It would be nice to be able to do the following to set bounds on variable arrays (or other variable containers):

@variable(m, [1,2] .<= x[1:2] .<= [3,4])

This currently throws a LoadError indicating that <= should be used instead. Using <= instead of the vectorized inequality instructs the user with "Instead of @variable(model, x[1:2] >= lb), do @variable(model, x[i=1:2] >= lb[i]). Alternatively, create the variable without bounds, then call set_lower_bound.(x, lb)." This makes perfect sense. Would it make sense to add the capability of passing arrays as variable bounds to generate bounded variables on the fly?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions