Skip to content

Commit 8694f95

Browse files
committed
addedconstrainttypes -> added_constraint_types
1 parent 5bf9e9c commit 8694f95

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

src/Bridges/bridge.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ Return a `Bool` indicating whether the bridges of type `BT` support bridging `F`
3838
MOI.supports_constraint(::Type{<:AbstractBridge}, ::Type{<:MOI.AbstractFunction}, ::Type{<:MOI.AbstractSet}) = false
3939

4040
"""
41-
addedconstrainttypes(BT::Type{<:AbstractBridge}, F::Type{<:MOI.AbstractFunction}, S::Type{<:MOI.AbstractSet})::Bool
41+
added_constraint_types(BT::Type{<:AbstractBridge}, F::Type{<:MOI.AbstractFunction}, S::Type{<:MOI.AbstractSet})::Bool
4242
4343
Return a list of the types of constraints that bridges of type `BT` add for
4444
bridging an `F`-in-`S` constraints.
4545
46-
addedconstrainttypes(BT::Type{<:AbstractBridge})::Bool
46+
added_constraint_types(BT::Type{<:AbstractBridge})::Bool
4747
4848
Return a list of the types of constraints that bridges of concrete type `BT` add
4949
for `F`-in-`S` constraints.
5050
"""
51-
function addedconstrainttypes(BT::Type{<:AbstractBridge},
51+
function added_constraint_types(BT::Type{<:AbstractBridge},
5252
F::Type{<:MOI.AbstractFunction},
5353
S::Type{<:MOI.AbstractSet})
54-
addedconstrainttypes(concrete_bridge_type(BT, F, S))
54+
added_constraint_types(concrete_bridge_type(BT, F, S))
5555
end
5656

5757

src/Bridges/detbridge.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function LogDetBridge{T}(model, f::MOI.VectorAffineFunction{T}, s::MOI.LogDetCon
8787
end
8888

8989
MOI.supports_constraint(::Type{LogDetBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.LogDetConeTriangle}) where T = true
90-
addedconstrainttypes(::Type{LogDetBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.LogDetConeTriangle}) where T = [(MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeTriangle), (MOI.VectorAffineFunction{T}, MOI.ExponentialCone), (MOI.ScalarAffineFunction{T}, MOI.LessThan{T})]
90+
added_constraint_types(::Type{LogDetBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.LogDetConeTriangle}) where T = [(MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeTriangle), (MOI.VectorAffineFunction{T}, MOI.ExponentialCone), (MOI.ScalarAffineFunction{T}, MOI.LessThan{T})]
9191

9292
"""
9393
sublog(model, x::MOI.VariableIndex, z::MOI.VariableIndex, ::Type{T}) where T
@@ -179,7 +179,7 @@ function RootDetBridge{T}(model, f::MOI.VectorAffineFunction{T}, s::MOI.RootDetC
179179
end
180180

181181
MOI.supports_constraint(::Type{RootDetBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.RootDetConeTriangle}) where T = true
182-
addedconstrainttypes(::Type{RootDetBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.RootDetConeTriangle}) where T = [(MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeTriangle), (MOI.VectorAffineFunction{T}, MOI.GeometricMeanCone)]
182+
added_constraint_types(::Type{RootDetBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.RootDetConeTriangle}) where T = [(MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeTriangle), (MOI.VectorAffineFunction{T}, MOI.GeometricMeanCone)]
183183

184184
# Attributes, Bridge acting as an model
185185
MOI.get(b::RootDetBridge, ::MOI.NumberOfVariables) = length(b.Δ)

src/Bridges/geomeanbridge.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function MOI.supports_constraint(::Type{GeoMeanBridge{T}},
100100
::Type{MOI.GeometricMeanCone}) where T
101101
return true
102102
end
103-
function addedconstrainttypes(::Type{GeoMeanBridge{T, F, G}}) where {T, F, G}
103+
function added_constraint_types(::Type{GeoMeanBridge{T, F, G}}) where {T, F, G}
104104
return [(F, MOI.LessThan{T}), (G, MOI.RotatedSecondOrderCone)]
105105
end
106106
function concrete_bridge_type(::Type{<:GeoMeanBridge{T}},

src/Bridges/intervalbridge.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function SplitIntervalBridge{T, F}(model, f::F, s::MOI.Interval{T}) where {T, F}
1414
end
1515

1616
MOI.supports_constraint(::Type{SplitIntervalBridge{T}}, ::Type{<:MOI.AbstractScalarFunction}, ::Type{MOI.Interval{T}}) where T = true
17-
function addedconstrainttypes(::Type{SplitIntervalBridge{T, F}}) where {T, F}
17+
function added_constraint_types(::Type{SplitIntervalBridge{T, F}}) where {T, F}
1818
return [(F, MOI.GreaterThan{T}), (F, MOI.LessThan{T})]
1919
end
2020
function concrete_bridge_type(::Type{<:SplitIntervalBridge},

src/Bridges/lazybridgeoptimizer.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ function update_dist!(b::LazyBridgeOptimizer, constraints)
4343
changed = false
4444
for BT in b.bridgetypes
4545
for (F, S) in constraints
46-
if MOI.supports_constraint(BT, F, S) && all(C -> MOI.supports_constraint(b, C[1], C[2]), addedconstrainttypes(BT, F, S))
46+
if MOI.supports_constraint(BT, F, S) && all(C -> MOI.supports_constraint(b, C[1], C[2]), added_constraint_types(BT, F, S))
4747
# Number of bridges needed using BT
48-
dist = 1 + sum(C -> _dist(b, C[1], C[2]), addedconstrainttypes(BT, F, S))
48+
dist = 1 + sum(C -> _dist(b, C[1], C[2]), added_constraint_types(BT, F, S))
4949
# Is it better that what can currently be done ?
5050
if dist < _dist(b, F, S)
5151
b.dist[(F, S)] = dist
@@ -69,7 +69,7 @@ function fill_required_constraints!(required::Set{Tuple{DataType, DataType}}, b:
6969
push!(required, (F, S))
7070
for BT in b.bridgetypes
7171
if MOI.supports_constraint(BT, F, S)
72-
for C in addedconstrainttypes(BT, F, S)
72+
for C in added_constraint_types(BT, F, S)
7373
fill_required_constraints!(required, b, C[1], C[2])
7474
end
7575
end

src/Bridges/rsocbridge.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function MOI.supports_constraint(::Type{RSOCBridge{T}},
4242
::Type{MOI.RotatedSecondOrderCone}) where T
4343
return true
4444
end
45-
function addedconstrainttypes(::Type{RSOCBridge{T, F}}) where {T, F}
45+
function added_constraint_types(::Type{RSOCBridge{T, F}}) where {T, F}
4646
return [(F, MOI.SecondOrderCone)]
4747
end
4848
function concrete_bridge_type(::Type{<:RSOCBridge{T}},

src/Bridges/soctopsdbridge.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ _SOCtoPSDaff(f::MOI.VectorOfVariables, ::Type{T}) where T = _SOCtoPSDaff(MOI.Vec
6565
_SOCtoPSDaff(f::MOI.VectorAffineFunction, ::Type) = _SOCtoPSDaff(f, MOIU.eachscalar(f)[1])
6666

6767
MOI.supports_constraint(::Type{SOCtoPSDBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.SecondOrderCone}) where T = true
68-
addedconstrainttypes(::Type{SOCtoPSDBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.SecondOrderCone}) where T = [(MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeTriangle)]
68+
added_constraint_types(::Type{SOCtoPSDBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.SecondOrderCone}) where T = [(MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeTriangle)]
6969

7070
function MOI.get(instance::MOI.AbstractOptimizer, a::MOI.ConstraintPrimal, c::SOCtoPSDBridge)
7171
MOI.get(instance, a, c.cr)[trimap.(1:c.dim, 1)]
@@ -115,7 +115,7 @@ struct RSOCtoPSDBridge{T} <: AbstractBridge
115115
end
116116

117117
MOI.supports_constraint(::Type{RSOCtoPSDBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.RotatedSecondOrderCone}) where T = true
118-
addedconstrainttypes(::Type{RSOCtoPSDBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.RotatedSecondOrderCone}) where T = [(MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeTriangle)]
118+
added_constraint_types(::Type{RSOCtoPSDBridge{T}}, ::Type{<:Union{MOI.VectorOfVariables, MOI.VectorAffineFunction{T}}}, ::Type{MOI.RotatedSecondOrderCone}) where T = [(MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeTriangle)]
119119

120120
function RSOCtoPSDBridge{T}(instance, f, s::MOI.RotatedSecondOrderCone) where T
121121
d = MOI.dimension(s)-1

src/Bridges/squarepsdbridge.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function MOI.supports_constraint(::Type{SquarePSDBridge{T}},
112112
::Type{MOI.PositiveSemidefiniteConeSquare}) where T
113113
return true
114114
end
115-
function addedconstrainttypes(::Type{SquarePSDBridge{T, F, G}}) where {T, F, G}
115+
function added_constraint_types(::Type{SquarePSDBridge{T, F, G}}) where {T, F, G}
116116
return [(F, MOI.PositiveSemidefiniteConeTriangle), (G, MOI.EqualTo{T})]
117117
end
118118
function concrete_bridge_type(::Type{<:SquarePSDBridge{T}},

0 commit comments

Comments
 (0)