using MathOptInterface; const MOI = MathOptInterface
function f()
model = MOI.Utilities.Model{Float64}()
x = MOI.add_variable(model)
c = MOI.add_constraint(model, 1.0 * MOI.SingleVariable(x), MOI.EqualTo(1.0))
@time MOI.get(model, MOI.CanonicalConstraintFunction(), c)
end
f()
gives
0.000001 seconds (1 allocation: 16 bytes)
I don't understand where this allocation comes from. It was allocation-free after #1318. This must be due to a recent change.
gives
I don't understand where this allocation comes from. It was allocation-free after #1318. This must be due to a recent change.