As mentioned by @matbesancon it isn't a good idea to have the type Function in constraints like:
mutable struct LinearConstraint{T <: Real} <: Constraint
idx :: Int
fct :: Function
...
because of dynamic dispatching this will be slower. The idea is to have a similar structure to MOI instead such that new constraints provide two functions:
prune_constraint(com, v::MOI.VectorOfVariables, set) for example or
prune_constraint(com, func:MOI.ScalarAffineFunction, set). As well as a
still_feasible(com,func,set, value, index) function in contrast to the current functions:
function all_different(com::CS.CoM, constraint::BasicConstraint; logs = true)
function all_different(com::CoM, constraint::Constraint, value::Int, index::Int)
As mentioned by @matbesancon it isn't a good idea to have the type
Function
in constraints like:because of dynamic dispatching this will be slower. The idea is to have a similar structure to
MOI
instead such that new constraints provide two functions:prune_constraint(com, v::MOI.VectorOfVariables, set)
for example orprune_constraint(com, func:MOI.ScalarAffineFunction, set)
. As well as astill_feasible(com,func,set, value, index)
function in contrast to the current functions: