@@ -455,9 +455,9 @@ nrmsd(a, b) = evaluate(NormRMSDeviation(), a, b)
455
455
456
456
# SqEuclidean
457
457
function pairwise! (r:: AbstractMatrix , dist:: SqEuclidean , a:: AbstractMatrix , b:: AbstractMatrix )
458
- At_mul_B ! (r, a, b)
459
- sa2 = sum (abs2, a, 1 )
460
- sb2 = sum (abs2, b, 1 )
458
+ mul ! (r, a' , b)
459
+ sa2 = sum (abs2, a, dims = 1 )
460
+ sb2 = sum (abs2, b, dims = 1 )
461
461
threshT = convert (eltype (r), dist. thresh)
462
462
if threshT <= 0
463
463
# If there's no chance of triggering the threshold, we can use @simd
492
492
493
493
function pairwise! (r:: AbstractMatrix , dist:: SqEuclidean , a:: AbstractMatrix )
494
494
m, n = get_pairwise_dims (r, a)
495
- At_mul_B ! (r, a, a)
495
+ mul ! (r, a' , a)
496
496
sa2 = sumsq_percol (a)
497
497
threshT = convert (eltype (r), dist. thresh)
498
498
@inbounds for j = 1 : n
525
525
# Euclidean
526
526
function pairwise! (r:: AbstractMatrix , dist:: Euclidean , a:: AbstractMatrix , b:: AbstractMatrix )
527
527
m, na, nb = get_pairwise_dims (r, a, b)
528
- At_mul_B ! (r, a, b)
528
+ mul ! (r, a' , b)
529
529
sa2 = sumsq_percol (a)
530
530
sb2 = sumsq_percol (b)
531
531
threshT = convert (eltype (r), dist. thresh)
552
552
553
553
function pairwise! (r:: AbstractMatrix , dist:: Euclidean , a:: AbstractMatrix )
554
554
m, n = get_pairwise_dims (r, a)
555
- At_mul_B ! (r, a, a)
555
+ mul ! (r, a' , a)
556
556
sa2 = sumsq_percol (a)
557
557
threshT = convert (eltype (r), dist. thresh)
558
558
@inbounds for j = 1 : n
580
580
581
581
function pairwise! (r:: AbstractMatrix , dist:: CosineDist , a:: AbstractMatrix , b:: AbstractMatrix )
582
582
m, na, nb = get_pairwise_dims (r, a, b)
583
- At_mul_B ! (r, a, b)
583
+ mul ! (r, a' , b)
584
584
ra = sqrt! (sumsq_percol (a))
585
585
rb = sqrt! (sumsq_percol (b))
586
586
for j = 1 : nb
@@ -592,7 +592,7 @@ function pairwise!(r::AbstractMatrix, dist::CosineDist, a::AbstractMatrix, b::Ab
592
592
end
593
593
function pairwise! (r:: AbstractMatrix , dist:: CosineDist , a:: AbstractMatrix )
594
594
m, n = get_pairwise_dims (r, a)
595
- At_mul_B ! (r, a, a)
595
+ mul ! (r, a' , a)
596
596
ra = sqrt! (sumsq_percol (a))
597
597
@inbounds for j = 1 : n
598
598
@simd for i = j + 1 : n
608
608
609
609
# CorrDist
610
610
_centralize_colwise (x:: AbstractVector ) = x .- mean (x)
611
- _centralize_colwise (x:: AbstractMatrix ) = x .- mean (x, 1 )
611
+ _centralize_colwise (x:: AbstractMatrix ) = x .- mean (x, dims = 1 )
612
612
function colwise! (r:: AbstractVector , dist:: CorrDist , a:: AbstractMatrix , b:: AbstractMatrix )
613
613
colwise! (r, CosineDist (), _centralize_colwise (a), _centralize_colwise (b))
614
614
end
0 commit comments