-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathCBF.jl
More file actions
73 lines (61 loc) · 1.48 KB
/
CBF.jl
File metadata and controls
73 lines (61 loc) · 1.48 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Copyright (c) 2017: Miles Lubin and contributors
# Copyright (c) 2017: Google Inc.
#
# Use of this source code is governed by an MIT-style license that can be found
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
module CBF
import ..FileFormats
import MathOptInterface as MOI
MOI.Utilities.@model(
Model,
(MOI.Integer,),
(),
(
MOI.Reals,
MOI.Zeros,
MOI.Nonnegatives,
MOI.Nonpositives,
MOI.SecondOrderCone,
MOI.RotatedSecondOrderCone,
MOI.PositiveSemidefiniteConeTriangle,
MOI.ExponentialCone,
MOI.DualExponentialCone,
),
(MOI.PowerCone, MOI.DualPowerCone),
(),
(),
(MOI.VectorOfVariables,),
(MOI.VectorAffineFunction,)
)
function MOI.supports_constraint(
::Model{T},
::Type{MOI.VariableIndex},
::Type{<:MOI.Utilities.SUPPORTED_VARIABLE_SCALAR_SETS{T}},
) where {T}
return false
end
function MOI.supports_constraint(
::Model,
::Type{MOI.VariableIndex},
::Type{MOI.Integer},
)
return true
end
MOI.supports(::Model, ::MOI.ObjectiveFunction) = false
function MOI.supports(
::Model{T},
::MOI.ObjectiveFunction{
<:Union{MOI.VariableIndex,MOI.ScalarAffineFunction{T}},
},
) where {T}
return true
end
"""
Model()
Create an empty instance of `FileFormats.CBF.Model`.
"""
Model(; kwargs...) = Model{Float64}()
Base.summary(io::IO, ::Model) = print(io, "MOI.FileFormats.CBF.Model")
include("read.jl")
include("write.jl")
end