Skip to content

Commit df15fb3

Browse files
committed
Also test on Symmetric
1 parent 7b66a9f commit df15fb3

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

test/affprop.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ using Statistics
4646
@test R.counts[i] == count(==(i), R.assignments)
4747
end
4848

49-
@testset "Ensure works on nonbasic array type (SubArray)" begin
50-
RR = affinityprop(@view S[:,:]) # run on complete subarray
51-
@test RR.assignments == R.assignments
49+
@testset "Ensure works on nonbasic array type" begin
50+
R2 = affinityprop(@view S[:,:]) # run on complete subarray
51+
@test R2.assignments == R.assignments
52+
53+
R3 = affinityprop(Symmetric(S)) # run on complete subarray
54+
@test R3.assignments == R.assignments
5255
end
5356

5457
#= compare with python result

test/dbscan.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ for c = 1:k
3636
end
3737
@test all(R.counts .>= 180)
3838

39-
@testset "Ensure works on nonbasic array type (SubArray)" begin
40-
RR = dbscan(@view(D[:,:]), 1.0, 10) # run on complete subarray
41-
@test RR.assignments == R.assignments
39+
@testset "Ensure works on nonbasic array type" begin
40+
R2 = dbscan(@view(D[:,:]), 1.0, 10) # run on complete subarray
41+
@test R2.assignments == R.assignments
42+
43+
R3 = dbscan(Symmetric(D), 1.0, 10) # run on complete subarray
44+
@test R3.assignments == R.assignments
4245
end
4346

4447
@testset "normal points" begin

test/kmedoids.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ R = kmedoids(dist, k)
4040
@test isapprox(sum(R.costs), R.totalcost)
4141
@test R.converged
4242

43-
@testset "Ensure works on nonbasic array type (SubArray)" begin
43+
@testset "Ensure works on nonbasic array type" begin
4444
Random.seed!(34568) # restore seed as kmedoids is not determantistic
45-
RR = kmedoids(@view(dist[:,:]), k) # run on complete subarray
46-
@test RR.assignments == R.assignments
45+
R2 = kmedoids(@view(dist[:,:]), k) # run on complete subarray
46+
@test R2.assignments == R.assignments
47+
48+
Random.seed!(34568) # restore seed as kmedoids is not determantistic
49+
R3 = kmedoids(Symmetric(dist), k) # run on complete subarray
50+
@test R3.assignments == R.assignments
4751
end
4852

4953
# k=1 and k=n cases

0 commit comments

Comments
 (0)