Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
eliascarv committed Oct 21, 2024
1 parent 4415e2a commit 39ea853
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/metrics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,27 @@ abstract type UnionSemiMetric <: SemiMetric end

abstract type UnionMetric <: Metric end

# a minkowski metric is a metric that is defined by the formula:
#
# d(x, y) = sum(w .* (x - y) .^ p) ^ (1 / p)
#
# where the `p` parameter defines the metric
# and `w` is a potential weight vector (all 1's by default).
"""
MinkowskiMetric
A Minkowski metric is a metric that is defined by the formula:
`d(x, y) = sum(w .* (x - y) .^ p) ^ (1 / p)`
where the `p` parameter defines the metric
and `w` is a potential weight vector (all 1's by default).
Common Minkowski metrics:
* `Cityblock`/`WeightedCityblock`: Minkowski metric with `p=1`;
* `Euclidean`/`WeightedEuclidean`: Minkowski metric with `p=2`;
* `Chebyshev`: Limit of `d` as `p` approaches infinity;
* `Minkowski`/`WeightedMinkowski`: generic Minkowski metric for any `p`.
## Notes
* The difference between `Minkowski`/`WeightedMinkowski` and `MinkowskiMetric`
is that while the first are generic Minkowski metrics,
the second is the parent type of these metrics.
"""
abstract type MinkowskiMetric <: UnionMetric end

###########################################################
Expand Down

0 comments on commit 39ea853

Please sign in to comment.