From ecfba4b2ee4a89a5b18ae8e00c160866a9bd1ba9 Mon Sep 17 00:00:00 2001 From: Elias Carvalho Date: Fri, 25 Oct 2024 16:54:48 -0300 Subject: [PATCH] Fix typo --- src/NearestNeighbors.jl | 4 ++-- src/evaluation.jl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/NearestNeighbors.jl b/src/NearestNeighbors.jl index 23b3799..6edbc1c 100644 --- a/src/NearestNeighbors.jl +++ b/src/NearestNeighbors.jl @@ -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) diff --git a/src/evaluation.jl b/src/evaluation.jl index 807adbf..358a397 100644 --- a/src/evaluation.jl +++ b/src/evaluation.jl @@ -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)