Abstract

Distance functions for numeric vectors.

Each distance function is exposed as a parametric modules that lets you control both the scalar type and the dimensionality of the space that the vectors inhabit. This is concretely done by specifying the representation of vectors as a module that implements the vector module type.

When using low-dimensional spaces (say, less than 10), use an appropriately constructed statically sized vector module (see vector_1 and cat_vector). For larger spaces, use any_vector.

Synopsis

open import "lib/github.com/athas/vector/vector"
open import "lib/github.com/athas/distance/has_distance"
module mk_braycurtis: (R: real) -> (V: vector) -> has_distance with t = V.vector R.t with distance = R.t
module mk_canberra: (R: real) -> (V: vector) -> has_distance with t = V.vector R.t with distance = R.t
module mk_chebyshev: (R: real) -> (V: vector) -> has_distance with t = V.vector R.t with distance = R.t
module mk_correlation: (R: real) -> (V: vector) -> has_distance with t = V.vector R.t with distance = R.t
module mk_cosine: (R: real) -> (V: vector) -> has_distance with t = V.vector R.t with distance = R.t
module mk_euclidean: (R: real) -> (V: vector) -> has_distance with t = V.vector R.t with distance = R.t
module mk_manhattan: (R: real) -> (V: vector) -> has_distance with t = V.vector R.t with distance = R.t
module mk_minkowski: (R: real) -> (V: vector) -> has_distance with t = V.vector R.t with distance = R.t
module mk_sqeuclidean: (R: real) -> (V: vector) -> has_distance with t = V.vector R.t with distance = R.t

Description

module mk_braycurtis

Bray-Curtis distance.

module mk_canberra

Canberra distance.

module mk_chebyshev

Chebyshev distance.

module mk_correlation

Correlation distance.

module mk_cosine

Cosine distance.

module mk_euclidean

Euclidean distance.

module mk_manhattan

Manhattan/cityblock distance.

module mk_minkowski

Order-2 Minkowski distance.

module mk_sqeuclidean

Squared euclidean distance.