Skip to content

Commit

Permalink
Avoid method ambiguities
Browse files Browse the repository at this point in the history
  • Loading branch information
Simone Carlo Surace authored and simsurace committed Jan 23, 2024
1 parent 912cc49 commit f990586
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/distances/sinus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Check warning on line 28 in src/distances/sinus.jl

View check run for this annotation

Codecov / codecov/patch

src/distances/sinus.jl#L26-L28

Added lines #L26 - L28 were not covered by tests
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)

Check warning on line 35 in src/distances/sinus.jl

View check run for this annotation

Codecov / codecov/patch

src/distances/sinus.jl#L30-L35

Added lines #L30 - L35 were not covered by tests

0 comments on commit f990586

Please sign in to comment.