Skip to content

Commit 90c7e46

Browse files
authored
Add blank lines between definitions (#2638)
1 parent 762ce28 commit 90c7e46

21 files changed

+50
-0
lines changed

perf/bellman_ford.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,39 @@ function MOI.supports_constraint(
2828
) where {T}
2929
return false
3030
end
31+
3132
function MOI.supports_constraint(
3233
::SDPAModel{T},
3334
::Type{MOI.VariableIndex},
3435
::Type{MOI.LessThan{T}},
3536
) where {T}
3637
return false
3738
end
39+
3840
function MOI.supports_constraint(
3941
::SDPAModel{T},
4042
::Type{MOI.VariableIndex},
4143
::Type{MOI.EqualTo{T}},
4244
) where {T}
4345
return false
4446
end
47+
4548
function MOI.supports_constraint(
4649
::SDPAModel{T},
4750
::Type{MOI.VariableIndex},
4851
::Type{MOI.Interval{T}},
4952
) where {T}
5053
return false
5154
end
55+
5256
function MOI.supports_constraint(
5357
::SDPAModel,
5458
::Type{MOI.VectorOfVariables},
5559
::Type{MOI.Reals},
5660
)
5761
return false
5862
end
63+
5964
function MOI.supports(
6065
::SDPAModel{T},
6166
::MOI.ObjectiveFunction{MOI.ScalarQuadraticFunction{T}},

src/Bridges/Constraint/single_bridge_optimizer.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ function MOI.Bridges.is_bridged(
8686
return MOI.Bridges.is_bridged(b, MOI.VariableIndex, S) &&
8787
haskey(Constraint.bridges(b), ci)
8888
end
89+
8990
function MOI.Bridges.is_bridged(
9091
b::SingleBridgeOptimizer,
9192
ci::MOI.ConstraintIndex{MOI.VectorOfVariables,S},

src/Bridges/Variable/set_map.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ function MOI.delete(
113113
MOI.delete(model, bridge.variable)
114114
return
115115
end
116+
116117
function MOI.delete(
117118
model::MOI.ModelLike,
118119
bridge::SetMapBridge{T,S1,S2},

src/FileFormats/MOF/write.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ head_name(::Type{MOI.LogDetConeSquare}) = "LogDetConeSquare"
476476
function head_name(::Type{MOI.PositiveSemidefiniteConeTriangle})
477477
return "PositiveSemidefiniteConeTriangle"
478478
end
479+
479480
function head_name(::Type{MOI.PositiveSemidefiniteConeSquare})
480481
return "PositiveSemidefiniteConeSquare"
481482
end

src/FileFormats/SDPA/SDPA.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function MOI.supports_constraint(
3030
) where {T}
3131
return false
3232
end
33+
3334
function MOI.supports_constraint(
3435
::Model,
3536
::Type{MOI.VariableIndex},
@@ -300,6 +301,7 @@ function _dim_to_set(s::AbstractString)
300301
return MOI.Nonnegatives(-block_dim)
301302
end
302303
end
304+
303305
function _parse_dimensions(dims::AbstractString)
304306
isvalid(char) = isdigit(char) || char == '-'
305307
is_delimiter(char) = isspace(char) || char == ','

src/Test/test_basic_constraint.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ _set(::Type{MOI.Integer}) = MOI.Integer()
100100
function _set(::Type{T}, ::Type{MOI.Semicontinuous}) where {T}
101101
return MOI.Semicontinuous(zero(T), one(T))
102102
end
103+
103104
function _set(::Type{T}, ::Type{MOI.Semiinteger}) where {T}
104105
return MOI.Semiinteger(zero(T), one(T))
105106
end
@@ -124,12 +125,15 @@ _set(::Type{MOI.NormNuclearCone}) = MOI.NormNuclearCone(2, 3)
124125
function _set(::Type{MOI.PositiveSemidefiniteConeTriangle})
125126
return MOI.PositiveSemidefiniteConeTriangle(3)
126127
end
128+
127129
function _set(::Type{MOI.PositiveSemidefiniteConeSquare})
128130
return MOI.PositiveSemidefiniteConeSquare(3)
129131
end
132+
130133
function _set(::Type{MOI.HermitianPositiveSemidefiniteConeTriangle})
131134
return MOI.HermitianPositiveSemidefiniteConeTriangle(3)
132135
end
136+
133137
function _set(::Type{MOI.Scaled{MOI.PositiveSemidefiniteConeTriangle}})
134138
return MOI.Scaled{MOI.PositiveSemidefiniteConeTriangle}(3)
135139
end

src/Test/test_model.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ function MOI.get(::BadModelAttributeModel, ::MOI.ListOfModelAttributesSet)
106106
end
107107

108108
struct UnknownVariableAttribute <: MOI.AbstractVariableAttribute end
109+
109110
struct BadVariableAttributeModel{T} <: BadModel{T}
110111
BadVariableAttributeModel(T = Float64) = new{T}()
111112
end

src/Utilities/cachingoptimizer.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,11 @@ function pass_nonvariable_constraints(
272272
constraint_types,
273273
)
274274
end
275+
275276
function final_touch(m::CachingOptimizer, index_map)
276277
return final_touch(m.model_cache, index_map)
277278
end
279+
278280
function MOI.copy_to(m::CachingOptimizer, src::MOI.ModelLike)
279281
if m.state == ATTACHED_OPTIMIZER
280282
reset_optimizer(m)
@@ -394,6 +396,7 @@ function MOI.supports_add_constrained_variable(
394396
MOI.supports_add_constrained_variable(m.optimizer, S)::Bool
395397
)
396398
end
399+
397400
function MOI.add_constrained_variable(
398401
m::CachingOptimizer,
399402
set::S,
@@ -1032,6 +1035,7 @@ function MOI.supports(
10321035
)
10331036
return MOI.supports(model.model_cache, attr, IndexType)
10341037
end
1038+
10351039
function MOI.set(
10361040
model::CachingOptimizer,
10371041
attr::Union{MOI.VariableName,MOI.ConstraintName},
@@ -1045,6 +1049,7 @@ end
10451049
function MOI.supports(m::CachingOptimizer, attr::MOI.Name)
10461050
return MOI.supports(m.model_cache, attr)
10471051
end
1052+
10481053
function MOI.set(model::CachingOptimizer, attr::MOI.Name, value)
10491054
MOI.set(model.model_cache, attr, value)
10501055
return
@@ -1205,12 +1210,14 @@ end
12051210
function map_indices_to_optimizer(m::CachingOptimizer, idx::MOI.Index)
12061211
return m.model_to_optimizer_map[idx]
12071212
end
1213+
12081214
function map_indices_to_optimizer(
12091215
m::CachingOptimizer,
12101216
indices::Vector{<:MOI.Index},
12111217
)
12121218
return getindex.(Ref(m.model_to_optimizer_map), indices)
12131219
end
1220+
12141221
function MOI.set(
12151222
m::CachingOptimizer,
12161223
attr::AttributeFromOptimizer{T},
@@ -1272,6 +1279,7 @@ function MOI.supports(
12721279
return caching_opt.optimizer !== nothing &&
12731280
MOI.supports(caching_opt.optimizer, sub)::Bool
12741281
end
1282+
12751283
function MOI.submit(
12761284
caching_opt::CachingOptimizer,
12771285
sub::MOI.AbstractSubmittable,

src/Utilities/mockoptimizer.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ function MOI.get(mock::MockOptimizer, attr::MOI.AbstractOptimizerAttribute)
465465
return MOI.get(mock.inner_model, attr)
466466
end
467467
end
468+
468469
function MOI.get(mock::MockOptimizer, attr::MOI.AbstractModelAttribute)
469470
if MOI.is_set_by_optimize(attr)
470471
return mock.model_attributes[attr]
@@ -680,6 +681,7 @@ function MOI.get(
680681
return _safe_get_result(mock.constraint_dual, attr, idx, "dual")
681682
end
682683
end
684+
683685
function MOI.get(
684686
mock::MockOptimizer,
685687
::MockConstraintAttribute,

src/Utilities/struct_of_constraints.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ function _add_variable(model::StructOfConstraints)
1919
model.num_variables += 1
2020
return broadcastcall(_add_variable, model)
2121
end
22+
2223
function _add_variables(model::StructOfConstraints, n)
2324
model.num_variables += n
2425
return broadcastcall(Base.Fix2(_add_variables, n), model)
2526
end
2627

2728
function final_touch(::Nothing, index_map) end
29+
2830
function final_touch(model::StructOfConstraints, index_map)
2931
broadcastcall(Base.Fix2(final_touch, index_map), model)
3032
return

0 commit comments

Comments
 (0)