Open Nuramon27 opened 5 years ago
You could check out my maths-traits
crate. While it doesn't currently have impl
s for the structs in the num
collection, there are norm, metric, and inner product traits, and I'd be open to contributions or feature requests.
This is the implementation mentioned in #121. Regarding the issue that there are many possible norms for a certain type (see comment https://github.com/rust-num/num-traits/issues/121#issuecomment-526777142 ): I think these traits would only be intended to be implemented on very basic types for which there is some notion of a standard norm, like the absolute value on floating point numbers and the euclidean norm on complex numbers and one-dimensional arrays.
Indeed in the meantime I started working a separate crate Norman which handles exactly this issue and provides a set of different norms on a single type.
I hoped that both might go well with each other: having num-traits for a simple answer to the question “how far are these two vectors apart” and a dedicated crate if full control is necessary over how this distance is calculated.