This took me a while to track down. It is the cause of the failure in jump-dev/JuMP.jl#4188 (comment)
The chain goes:
Phew!
Here's a MWE:
julia> import MathOptInterface as MOI
julia> MOI.Utilities.@product_of_sets(_Cones, MOI.Zeros)
julia> const OptimizerCache{T} = MOI.Utilities.GenericModel{
T,
MOI.Utilities.ObjectiveContainer{T},
MOI.Utilities.VariablesContainer{T},
MOI.Utilities.MatrixOfConstraints{
T,
MOI.Utilities.MutableSparseMatrixCSC{
T,
Int,
MOI.Utilities.OneBasedIndexing,
},
Vector{T},
_Cones{T},
},
};
julia> model = OptimizerCache{Float64}();
julia> f = MOI.VectorAffineFunction(MOI.VectorAffineTerm{Float64}[], Float64[]);
julia> c = MOI.add_constraint(model, f, MOI.Zeros(0))
MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Zeros}(1)
julia> MOI.Utilities.final_touch(model, nothing)
julia> MOI.get(model, MOI.ListOfConstraintTypesPresent())
Tuple{Type, Type}[]
julia> F, S = MOI.VectorAffineFunction{Float64}, MOI.Zeros
(MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Zeros)
julia> MOI.get(model, MOI.NumberOfConstraints{F,S}())
0
julia> MOI.get(model, MOI.ListOfConstraintIndices{F,S}())
MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.Zeros}[]
This took me a while to track down. It is the cause of the failure in jump-dev/JuMP.jl#4188 (comment)
The chain goes:
add_constraintPhew!
Here's a MWE: