nalgebra/src/traits/norm.rs

20 lines
463 B
Rust
Raw Normal View History

2013-05-19 01:04:03 +08:00
pub trait Norm<T>
{
/// Computes the norm a an object.
fn norm(&self) -> T;
/**
* Computes the squared norm of an object.
*
* Computes the squared norm of an object. Computation of the squared norm
* is usually faster than the norm itself.
*/
fn sqnorm(&self) -> T;
/// Returns the normalized version of the argument.
fn normalized(&self) -> Self;
/// Inplace version of `normalized`.
fn normalize(&mut self) -> T;
}