pub trait Vector: Copy + Clonewhere
Self: Array<Element = Self::Scalar> + Add<Self, Output = Self> + Sub<Self, Output = Self> + Mul<Self, Output = Self> + Div<Self, Output = Self> + Rem<Self, Output = Self> + Add<Self::Scalar, Output = Self> + Sub<Self::Scalar, Output = Self> + Mul<Self::Scalar, Output = Self> + Div<Self::Scalar, Output = Self> + Rem<Self::Scalar, Output = Self>,{
type Scalar: BaseNum;
// Required methods
fn from_value(scalar: Self::Scalar) -> Self;
fn dot(self, other: Self) -> Self::Scalar;
// Provided method
fn zero() -> Self { ... }
}
Expand description
A trait that specifies a range of numeric operations for vectors. Not all of these make sense from a linear algebra point of view, but are included for pragmatic reasons.
Required Associated Types§
Required Methods§
sourcefn from_value(scalar: Self::Scalar) -> Self
fn from_value(scalar: Self::Scalar) -> Self
Construct a vector from a single value, replicating it.