pub struct Vector<T> { /* private fields */ }Expand description
A Vector with generic type items.
Can be indexed by vector[i]
Implementations§
Source§impl<T> Vector<T>
impl<T> Vector<T>
Sourcepub fn mag_sqr<O>(self) -> O
pub fn mag_sqr<O>(self) -> O
Returns the square of the Magnitude (also called Norm) of the Vector
Sourcepub fn mag<O, U>(self) -> O
pub fn mag<O, U>(self) -> O
Returns the Magnitude (also called Norm) of the Vector
Sourcepub fn dot<U, O: Add<Output = O> + MatrixElement>(
self,
rhs: Vector<U>,
) -> Result<O, DimensionsDontMatch<usize, usize>>where
T: Mul<U, Output = O>,
pub fn dot<U, O: Add<Output = O> + MatrixElement>(
self,
rhs: Vector<U>,
) -> Result<O, DimensionsDontMatch<usize, usize>>where
T: Mul<U, Output = O>,
Returns the Dot Product of the Vector and rhs
Trait Implementations§
Source§impl<T: Add<U, Output = O>, U, O> Add<Vector<U>> for Vector<T>
Adds two vectors element by element
impl<T: Add<U, Output = O>, U, O> Add<Vector<U>> for Vector<T>
Adds two vectors element by element
Source§impl<T> FromIterator<T> for Vector<T>
impl<T> FromIterator<T> for Vector<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<T> IntoIterator for Vector<T>
impl<T> IntoIterator for Vector<T>
Source§impl<T, U, O> Sub<Vector<U>> for Vector<T>where
T: Sub<U, Output = O>,
Subtracts two vectors element by element
impl<T, U, O> Sub<Vector<U>> for Vector<T>where
T: Sub<U, Output = O>,
Subtracts two vectors element by element
impl<T: Eq> Eq for Vector<T>
impl<T> StructuralPartialEq for Vector<T>
Auto Trait Implementations§
impl<T> Freeze for Vector<T>
impl<T> RefUnwindSafe for Vector<T>where
T: RefUnwindSafe,
impl<T> Send for Vector<T>where
T: Send,
impl<T> Sync for Vector<T>where
T: Sync,
impl<T> Unpin for Vector<T>where
T: Unpin,
impl<T> UnwindSafe for Vector<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more