Trait lowdim::Vector [−][src]
pub trait Vector<S> where
S: Integer,
Self: Clone + Copy,
Self: Index<usize, Output = S>,
Self: PartialOrd,
Self: VectorOps<S, Self>,
Self: for<'a> VectorOps<S, &'a Self>,
Self: Div<S, Output = Self>,
Self: for<'a> Div<&'a S, Output = Self>, {
const DIM: usize;
fn with<F>(f: F) -> Self
where
F: Fn(usize) -> S;
fn norm_l1(&self) -> S;
fn norm_l_infty(&self) -> S;
fn unit_vecs_l_infty() -> Vec<Self>;
fn lex_cmp(&self, other: &Self) -> Ordering;
fn zero() -> Self { ... }
fn is_zero(&self) -> bool { ... }
fn min(&self, other: Self) -> Self { ... }
fn max(&self, other: Self) -> Self { ... }
fn signum(&self) -> Self { ... }
fn unit_vecs() -> Vec<Self> { ... }
fn unit_vecs_l1() -> Vec<Self> { ... }
}Expand description
Required traits and operations for vectors.
Associated Constants
Required methods
Create a vector from a function which computes the coordinates.
The function must return a scalar value for each possible coordinate index.
Example
assert_eq!(v4d(0, 1, 2, 3), Vec4d::with(|i| i64::try_from(i).unwrap()));fn norm_l_infty(&self) -> S
fn norm_l_infty(&self) -> S
The maximum, Chebychev or L∞ norm.
fn unit_vecs_l_infty() -> Vec<Self>
fn unit_vecs_l_infty() -> Vec<Self>
Creates a vector of the vectors with L∞ norm equal to 1.
These correspond to a single orthogonal or diagonal step.
Provided methods
Signum by component.
Maps a vector to a unit step in the L∞ norm. This is a step on a shortest path w.r.t. L∞ along the vector.
fn unit_vecs_l1() -> Vec<Self>
fn unit_vecs_l1() -> Vec<Self>
Creates a vector of the vectors to orthogonal neighbours.
These are the vectors with L1 norm equal to 1.