Commit Graph

3 Commits

Author SHA1 Message Date
Manuel Simon bd65144d94 Add tests for implementations of `Norm` and `Distance`. 2019-08-07 21:31:35 +02:00
Manuel Simon cc0131d0dd Add documentation for the `dist` module and the `Distance` and `Norm` traits. 2019-08-07 21:20:59 +02:00
Manuel Simon bef01a8a86 Add traits `Distance` and `Norm` in order to provide abstract notions of distances between numbers.
The `Norm` trait provides a `norm` function for types that represent a normed vector space – e.g. the absolute value of a float or the norm of a complex number.

The `Distance` trait provides a `distance` function to still calculate the distance between two values if no sensible norm can be defined.
2019-08-07 20:53:05 +02:00