Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
eliascarv committed Oct 25, 2024
1 parent bd1cc30 commit ecfba4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/NearestNeighbors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export Euclidean,

abstract type NNTree{V <: AbstractVector,P <: PreMetric} end

const NonweightedMinowskiMetric = Union{Euclidean,Chebyshev,Cityblock,Minkowski}
const WeightedMinowskiMetric = Union{WeightedEuclidean,WeightedCityblock,WeightedMinkowski}
const NonweightedMinkowskiMetric = Union{Euclidean,Chebyshev,Cityblock,Minkowski}
const WeightedMinkowskiMetric = Union{WeightedEuclidean,WeightedCityblock,WeightedMinkowski}
const MinkowskiMetric = UnionMinkowskiMetric
function check_input(::NNTree{V1}, ::AbstractVector{V2}) where {V1, V2 <: AbstractVector}
if length(V1) != length(V2)
Expand Down
4 changes: 2 additions & 2 deletions src/evaluation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
@inline eval_pow(::WeightedEuclidean, s) = abs2(s)
@inline eval_pow(d::Minkowski, s) = abs(s)^d.p

@inline eval_diff(::NonweightedMinowskiMetric, a, b, dim) = a - b
@inline eval_diff(::NonweightedMinkowskiMetric, a, b, dim) = a - b
@inline eval_diff(::Chebyshev, ::Any, b, dim) = b
@inline eval_diff(m::WeightedMinowskiMetric, a, b, dim) = m.weights[dim] * (a-b)
@inline eval_diff(m::WeightedMinkowskiMetric, a, b, dim) = m.weights[dim] * (a-b)

function evaluate_maybe_end(d::Distances.UnionMetrics, a::AbstractVector,
b::AbstractVector, do_end::Bool)
Expand Down

0 comments on commit ecfba4b

Please sign in to comment.