You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> using Distances
julia> d = Minkowski(0.5);
julia> a=[1.0,0.0]; b=[0.0,1.0]; c=[0.0,0.0];
julia> evaluate(d, a, b) - evaluate(d,a,c) - evaluate(d,c,b)
2.0
julia> d isa Metric
true
This violates the triangle inequality. For p<1 we should probably throw in the constructor, or skip the outer root (then L^p for p<1 can be considered a metric vector space, albeit not locally convex). Skipping the outer root means something like
julia> using Distances
julia> import Distances.evaluate
julia> struct M<:Metric end
julia> evaluate(::M, x, y) = sum(t->sqrt(abs(t)) , x-y)
The text was updated successfully, but these errors were encountered:
This violates the triangle inequality. For
p<1
we should probably throw in the constructor, or skip the outer root (then L^p for p<1 can be considered a metric vector space, albeit not locally convex). Skipping the outer root means something likeThe text was updated successfully, but these errors were encountered: