File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1+ """
2+ MutLessThan{T<:Real} <: MOI.AbstractScalarSet
3+
4+ A mutable `LessThan`-like set to test `copy` of indicator set
5+ """
6+ mutable struct MutLessThan{T<: Real } <: MOI.AbstractScalarSet
7+ upper:: T
8+ MutLessThan (v:: T ) where {T<: Real } = new {T} (v)
9+ end
10+
11+ Base. copy (mlt:: MutLessThan ) = MutLessThan (Base. copy (mlt. upper))
12+
113@testset " Sets" begin
214 @testset " Copy" begin
315 @testset " for $S " for S in [MOI. SOS1, MOI. SOS2]
1527 @test s1 == s1_copy
1628 @test s2_copy isa MOI. IndicatorSet{MOI. ACTIVATE_ON_ZERO}
1729 @test s2 == s2_copy
30+ s3 = MOI. IndicatorSet {MOI.ACTIVATE_ON_ZERO} (MutLessThan (4.0 ))
31+ s3_copy = copy (s3)
32+ @test s3. set. upper ≈ 4.0
33+ s3_copy. set. upper = 5.0
34+ @test s3. set. upper ≈ 4.0
35+ @test s3_copy. set. upper ≈ 5.0
1836 end
1937 end
2038end
You can’t perform that action at this time.
0 commit comments