diff --git a/src/distances/sinus.jl b/src/distances/sinus.jl index 706c1f5f8..d6ba786a4 100644 --- a/src/distances/sinus.jl +++ b/src/distances/sinus.jl @@ -27,3 +27,9 @@ pairwise(d::Sinus, x::AbstractVector{<:Real}) = pairwise(d, x, x) function pairwise(d::Sinus, x::AbstractVector{<:Real}, y::AbstractVector{<:Real}) return abs2.(sinpi.(x .- y') ./ only(d.r)) end +pairwise(d::Sinus, x::RowVecs) = Distances_pairwise(d, x.X; dims=1) +pairwise(d::Sinus, x::ColVecs) = Distances_pairwise(d, x.X; dims=2) +pairwise(d::Sinus, x::RowVecs, y::RowVecs) = Distances_pairwise(d, x.X, y.X; dims=1) +pairwise(d::Sinus, x::ColVecs, y::RowVecs) = pairwise(d, x, ColVecs(permutedims(y.X))) +pairwise(d::Sinus, x::RowVecs, y::ColVecs) = pairwise(d, ColVecs(permutedims(x.X)), y) +pairwise(d::Sinus, x::ColVecs, y::ColVecs) = Distances_pairwise(d, x.X, y.X; dims=2)