/
empty_bridge.jl
33 lines (29 loc) · 1.15 KB
/
empty_bridge.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
struct EmptyBridge{T} <: MOIB.AbstractBridge
end
function EmptyBridge{T}(model::MOI.ModelLike, f::MOI.AbstractVectorFunction,
s::EmptyCone) where {T}
@assert MOI.output_dimension(f) == MOI.dimension(s)
return EmptyBridge{T}()
end
function MOI.supports_constraint(::Type{<:EmptyBridge},
::Type{<:MOI.AbstractVectorFunction},
::Type{<:EmptyCone})
return true
end
function MOIB.added_constraint_types(::Type{<:EmptyBridge{T}}) where {T}
# TODO remove vov-in-Nonneg when MOI v0.8.3 is released
return Tuple{DataType, DataType}[(MOI.VectorOfVariables, MOI.Nonnegatives)]
end
function MOIB.concrete_bridge_type(::Type{<:EmptyBridge{T}},
::Type{<:MOI.AbstractVectorFunction},
::Type{EmptyCone}) where T
return EmptyBridge{T}
end
# Indices
function MOI.delete(model::MOI.ModelLike, bridge::EmptyBridge) end
# TODO ConstraintPrimal
function MOI.get(::MOI.ModelLike,
::Union{MOI.ConstraintDual, MOI.ConstraintPrimal},
bridge::EmptyBridge{T}) where T
return T[]
end