@@ -9,7 +9,7 @@ using Test
99 n = 10
1010 X0 = randn (d, n)
1111 G0 = X0' X0
12- D0 = MultivariateStats. pairwise ((x,y)-> norm (x- y), X0 )
12+ D0 = MultivariateStats. pairwise ((x,y)-> norm (x- y), eachcol (X0), symmetric = true )
1313
1414 # # conversion between dmat and gram
1515
@@ -35,7 +35,7 @@ using Test
3535
3636 X = transform (M)
3737 @test size (X) == (3 ,n)
38- @test MultivariateStats. pairwise ((x,y)-> norm (x- y), X ) ≈ D0
38+ @test MultivariateStats. pairwise ((x,y)-> norm (x- y), eachcol (X0), symmetric = true ) ≈ D0
3939
4040 @test_throws DimensionMismatch transform (M, rand (d+ 1 ))
4141 y = transform (M, X0[:, 1 ])
@@ -49,11 +49,11 @@ using Test
4949
5050 X = transform (M)
5151 @test size (X) == (3 ,n)
52- @test MultivariateStats. pairwise ((x,y)-> norm (x- y), X ) ≈ D0
52+ @test MultivariateStats. pairwise ((x,y)-> norm (x- y), eachcol (X0), symmetric = true ) ≈ D0
5353
5454 @test_throws AssertionError transform (M, X0[:, 1 ])
5555 @test_throws DimensionMismatch transform (M, rand (d+ 1 ); distances = true )
56- d = MultivariateStats. pairwise ((x,y)-> norm (x- y), X0, X0[:,2 ]) |> vec
56+ d = MultivariateStats. pairwise ((x,y)-> norm (x- y), X0, X0[:,2 ]) # |> vec
5757 y = transform (M, d, distances= true )
5858 @test X[:, 2 ] ≈ y
5959
@@ -95,18 +95,18 @@ using Test
9595
9696 M = fit (MDS, sqrt .(D), maxoutdim= 2 , distances= true )
9797 X = transform (M)
98- @test D ≈ MultivariateStats. pairwise ((x,y)-> sum (abs2, x- y), X )
98+ @test D ≈ MultivariateStats. pairwise ((x,y)-> sum (abs2, x- y), eachcol (X), symmetric = true )
9999 @test eltype (X) == Float32
100100
101101 a = Float32[0.5 , 0.5 , 0.5 , 0.5 ]
102102 A = vcat (hcat (D, a), hcat (a' , zeros (Float32, 1 , 1 )))
103103 M⁺ = fit (MDS, sqrt .(A), maxoutdim= 2 , distances= true )
104104 X⁺ = transform (M⁺)
105- @test A ≈ MultivariateStats. pairwise ((x,y)-> sum (abs2, x- y), X⁺ )
105+ @test A ≈ MultivariateStats. pairwise ((x,y)-> sum (abs2, x- y), eachcol (X⁺), symmetric = true )
106106
107107 y = transform (M, a, distances= true )
108108 Y = [X y]
109- @test A ≈ MultivariateStats. pairwise ((x,y)-> sum (abs2, x- y), Y )
109+ @test A ≈ MultivariateStats. pairwise ((x,y)-> sum (abs2, x- y), eachcol (Y), symmetric = true )
110110 @test eltype (Y) == Float32
111111
112112 # different input types
0 commit comments