@@ -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
3341end
3442
3543const 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])
8486end
8587
8688function MOI. supports_constraint (
229231# evaluating the primal of the free rows. Throw an error instead.
230232function _get_free_start (
231233 :: SplitHyperRectangleBridge ,
232- attr:: MOI.ConstraintPrimal
234+ attr:: MOI.ConstraintPrimal ,
233235)
234236 return throw (MOI. GetAttributeNotAllowed (attr))
235237end
0 commit comments