Skip to content

Commit e25ddd7

Browse files
committed
Update
1 parent 661c278 commit e25ddd7

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

src/Bridges/Constraint/bridges/SplitHyperRectangleBridge.jl

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ mutable struct SplitHyperRectangleBridge{T,G,F} <: AbstractBridge
3030
free_rows::F
3131
free_primal_start::Union{Nothing,Vector{T}}
3232
free_dual_start::Union{Nothing,Vector{T}}
33+
34+
function SplitHyperRectangleBridge{T,G,F}(
35+
ci::Union{Nothing,MOI.ConstraintIndex{G,MOI.Nonnegatives}},
36+
set::MOI.HyperRectangle{T},
37+
free_rows::F,
38+
)
39+
return new{T,G,F}(ci, set, free_rows, nothing, nothing)
40+
end
3341
end
3442

3543
const SplitHyperRectangle{T,OT<:MOI.ModelLike} =
@@ -70,17 +78,11 @@ function bridge_constraint(
7078
end
7179
end
7280
if length(free_rows) == N
73-
return SplitHyperRectangleBridge{T,G,F}(nothing, s, f, nothing, nothing)
81+
return SplitHyperRectangleBridge{T,G,F}(nothing, s, f)
7482
end
7583
g = MOI.Utilities.vectorize(g_vec[rows_to_keep])
7684
ci = MOI.add_constraint(model, g, MOI.Nonnegatives(MOI.output_dimension(g)))
77-
return SplitHyperRectangleBridge{T,G,F}(
78-
ci,
79-
s,
80-
scalars[free_rows],
81-
nothing,
82-
nothing,
83-
)
85+
return SplitHyperRectangleBridge{T,G,F}(ci, s, scalars[free_rows])
8486
end
8587

8688
function MOI.supports_constraint(
@@ -229,7 +231,7 @@ end
229231
# evaluating the primal of the free rows. Throw an error instead.
230232
function _get_free_start(
231233
::SplitHyperRectangleBridge,
232-
attr::MOI.ConstraintPrimal
234+
attr::MOI.ConstraintPrimal,
233235
)
234236
return throw(MOI.GetAttributeNotAllowed(attr))
235237
end

0 commit comments

Comments
 (0)