pub trait Vector<'a>{
type Value: 'a + ValueType;
type IterVal: Iterator<Item = Self::Value>;
Show 15 methods
// Required methods
fn iter(&'a self) -> Self::IterVal;
fn with_capacity(cap: usize) -> Self;
fn from_vec(vec: Vec<Self::Value>) -> Self;
fn dim(&self) -> usize;
fn get(&self, i: usize) -> Self::Value;
fn get_mut(&mut self, i: usize) -> &mut Self::Value;
fn add(&'a mut self, rhs: &Self);
fn sub(&'a mut self, rhs: &Self);
fn scale(&'a mut self, rhs: Self::Value);
// Provided methods
fn new() -> Self { ... }
fn set(&mut self, i: usize, val: Self::Value) { ... }
fn add_to(&mut self, i: usize, val: Self::Value) { ... }
fn inner_prod<V>(&'a self, rhs: &'a V) -> Self::Value
where V: Vector<'a, Value = Self::Value> { ... }
fn norm_squared(&'a self) -> Self::Value { ... }
fn norm(&'a self) -> f64 { ... }
}Required Associated Types§
Required Methods§
fn iter(&'a self) -> Self::IterVal
fn with_capacity(cap: usize) -> Self
fn from_vec(vec: Vec<Self::Value>) -> Self
fn dim(&self) -> usize
fn get(&self, i: usize) -> Self::Value
fn get_mut(&mut self, i: usize) -> &mut Self::Value
fn add(&'a mut self, rhs: &Self)
fn sub(&'a mut self, rhs: &Self)
fn scale(&'a mut self, rhs: Self::Value)
Provided Methods§
fn new() -> Self
fn set(&mut self, i: usize, val: Self::Value)
fn add_to(&mut self, i: usize, val: Self::Value)
fn inner_prod<V>(&'a self, rhs: &'a V) -> Self::Value
fn norm_squared(&'a self) -> Self::Value
fn norm(&'a self) -> f64
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.