Dispatching on the type of a constraint or variable

If you just want to distinguish variables, use:

f(x::VariableRef) = dual(LowerBoundRef(x))
f(x::ConstraintRef) = dual(x)
1 Like