File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,12 @@ using Statistics
46
46
@test R. counts[i] == count (== (i), R. assignments)
47
47
end
48
48
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
52
55
end
53
56
54
57
#= compare with python result
Original file line number Diff line number Diff line change @@ -36,9 +36,12 @@ for c = 1:k
36
36
end
37
37
@test all (R. counts .>= 180 )
38
38
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
42
45
end
43
46
44
47
@testset " normal points" begin
Original file line number Diff line number Diff line change @@ -40,10 +40,14 @@ R = kmedoids(dist, k)
40
40
@test isapprox (sum (R. costs), R. totalcost)
41
41
@test R. converged
42
42
43
- @testset " Ensure works on nonbasic array type (SubArray) " begin
43
+ @testset " Ensure works on nonbasic array type" begin
44
44
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
47
51
end
48
52
49
53
# k=1 and k=n cases
You can’t perform that action at this time.
0 commit comments