Skip to content

Commit 661313a

Browse files
committed
Update
1 parent ba75dc1 commit 661313a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Utilities/copy.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,15 +511,17 @@ function _build_copy_variables_with_set_cache(
511511
::Type{S},
512512
) where {S<:MOI.AbstractScalarSet}
513513
F = MOI.VariableIndex
514+
indices = MOI.ConstraintIndex{F,S}[]
514515
for ci in MOI.get(src, MOI.ListOfConstraintIndices{F,S}())
515516
f = MOI.get(src, MOI.ConstraintFunction(), ci)
516517
if f in cache.variables_with_domain
517-
push!(cache.constraints_not_added, ci)
518+
push!(indices, ci)
518519
else
519520
push!(cache.variables_with_domain, f)
520521
push!(cache.variable_cones, ([f], ci))
521522
end
522523
end
524+
push!(cache.constraints_not_added, indices)
523525
return
524526
end
525527

@@ -544,6 +546,7 @@ function _build_copy_variables_with_set_cache(
544546
::Type{S},
545547
) where {S<:MOI.AbstractVectorSet}
546548
F = MOI.VectorOfVariables
549+
indices = MOI.ConstraintIndex{F,S}[]
547550
for ci in MOI.get(src, MOI.ListOfConstraintIndices{F,S}())
548551
f = MOI.get(src, MOI.ConstraintFunction(), ci)
549552
if _is_variable_cone(cache, f)
@@ -552,15 +555,16 @@ function _build_copy_variables_with_set_cache(
552555
end
553556
push!(cache.variable_cones, (f.variables, ci))
554557
else
555-
push!(cache.constraints_not_added, ci)
558+
push!(indices, ci)
556559
end
557560
end
561+
push!(cache.constraints_not_added, indices)
558562
return
559563
end
560564

561565
function _copy_variables_with_set(dest, src)
562-
vis_src = MOI.get(src, MOI.ListOfVariableIndices())
563566
index_map = IndexMap()
567+
vis_src = MOI.get(src, MOI.ListOfVariableIndices())
564568
cache = _CopyVariablesWithSetCache()
565569
for (i, v) in enumerate(vis_src)
566570
cache.variable_to_column[v] = i

0 commit comments

Comments
 (0)