Skip to content

Commit aa03be1

Browse files
committed
use correct tests for weighted gadgets
1 parent d662fcc commit aa03be1

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

test/weighted.jl

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,21 @@ using Random
1414
@assert length(locs1) == nv(g1)
1515
gp1 = Independence(g1, openvertices=pins1)
1616
gp2 = Independence(g2, openvertices=pins2)
17-
m1 = mis_compactify!(missize(gp1, getfield.(locs1, :weight)))
18-
m2 = mis_compactify!(missize(gp2, getfield.(locs2, :weight)))
17+
w1 = getfield.(locs1, :weight)
18+
w2 = getfield.(locs2, :weight)
19+
w1[pins1] .-= 1
20+
w2[pins2] .-= 1
21+
m1 = missize(gp1, w1)
22+
m2 = missize(gp2, w2)
23+
mm1 = maximum(m1)
24+
mm2 = maximum(m2)
1925
@test nv(g1) == length(locs1) && nv(g2) == length(locs2)
20-
sig, diff = UnitDiskMapping.is_diff_by_const(content.(m1), content.(m2))
21-
@test sig
22-
@test diff == -mis_overhead(s)
26+
if !(all((mm1 .== m1) .== (mm2 .== m2)))
27+
@show m1
28+
@show m2
29+
end
30+
@test all((mm1 .== m1) .== (mm2 .== m2))
31+
@test content(mm1 / mm2) == -mis_overhead(s)
2332
end
2433
end
2534

0 commit comments

Comments
 (0)