pub struct Vector<E, const LEN: usize>(pub [E; LEN])
where
E: MatEl;Expand description
A vector structure.
Tuple Fields§
§0: [E; LEN]Implementations§
Source§impl<E: MatEl + NdFloat, const LEN: usize> Vector<E, LEN>
impl<E: MatEl + NdFloat, const LEN: usize> Vector<E, LEN>
Sourcepub fn min(self, rhs: Self) -> Self
pub fn min(self, rhs: Self) -> Self
Compute a vector, whose elements are minimum of both vectors: r[ i ] = a[ i ].min( b [ i ] )
Sourcepub fn max(self, rhs: Self) -> Self
pub fn max(self, rhs: Self) -> Self
Compute a vector, whose elements are maximum of both vectors: r[ i ] = a[ i ].max( b [ i ] )
Sourcepub fn distance(&self, rhs: &Self) -> E
pub fn distance(&self, rhs: &Self) -> E
Computes length of the vector between two points in space
Sourcepub fn distance_squared(&self, rhs: &Self) -> E
pub fn distance_squared(&self, rhs: &Self) -> E
Computes squared length of the vector between two points in space
Trait Implementations§
Source§impl<E, const LEN: usize> AddAssign for Vector<E, LEN>
impl<E, const LEN: usize> AddAssign for Vector<E, LEN>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl<E, const LEN: usize> DivAssign<E> for Vector<E, LEN>
impl<E, const LEN: usize> DivAssign<E> for Vector<E, LEN>
Source§fn div_assign(&mut self, rhs: E)
fn div_assign(&mut self, rhs: E)
Performs the
/= operation. Read moreSource§impl<E, const ROWS: usize, const COLS: usize, Descriptor> Mul<&Vector<E, COLS>> for &Mat<ROWS, COLS, E, Descriptor>where
Descriptor: Descriptor,
E: MatEl + NdFloat,
Mat<ROWS, COLS, E, Descriptor>: Indexable<Index = Ix2> + IndexingRef<Scalar = E>,
impl<E, const ROWS: usize, const COLS: usize, Descriptor> Mul<&Vector<E, COLS>> for &Mat<ROWS, COLS, E, Descriptor>where
Descriptor: Descriptor,
E: MatEl + NdFloat,
Mat<ROWS, COLS, E, Descriptor>: Indexable<Index = Ix2> + IndexingRef<Scalar = E>,
Source§impl<E, const ROWS: usize, const COLS: usize, Descriptor> Mul<Vector<E, COLS>> for Mat<ROWS, COLS, E, Descriptor>where
Descriptor: Descriptor,
E: MatEl + NdFloat,
Mat<ROWS, COLS, E, Descriptor>: Indexable<Index = Ix2> + IndexingRef<Scalar = E>,
impl<E, const ROWS: usize, const COLS: usize, Descriptor> Mul<Vector<E, COLS>> for Mat<ROWS, COLS, E, Descriptor>where
Descriptor: Descriptor,
E: MatEl + NdFloat,
Mat<ROWS, COLS, E, Descriptor>: Indexable<Index = Ix2> + IndexingRef<Scalar = E>,
Source§impl<E, const LEN: usize> MulAssign<E> for Vector<E, LEN>
impl<E, const LEN: usize> MulAssign<E> for Vector<E, LEN>
Source§fn mul_assign(&mut self, rhs: E)
fn mul_assign(&mut self, rhs: E)
Performs the
*= operation. Read moreSource§impl<E, const ROWS: usize, const COLS: usize, Descriptor> MulAssign<Mat<ROWS, COLS, E, Descriptor>> for Vector<E, COLS>where
Descriptor: Descriptor,
E: MatEl + NdFloat,
Mat<ROWS, COLS, E, Descriptor>: Indexable<Index = Ix2> + IndexingRef<Scalar = E>,
impl<E, const ROWS: usize, const COLS: usize, Descriptor> MulAssign<Mat<ROWS, COLS, E, Descriptor>> for Vector<E, COLS>where
Descriptor: Descriptor,
E: MatEl + NdFloat,
Mat<ROWS, COLS, E, Descriptor>: Indexable<Index = Ix2> + IndexingRef<Scalar = E>,
Source§fn mul_assign(&mut self, rhs: Mat<ROWS, COLS, E, Descriptor>)
fn mul_assign(&mut self, rhs: Mat<ROWS, COLS, E, Descriptor>)
Performs the
*= operation. Read moreSource§impl<E, const LEN: usize> PartialOrd for Vector<E, LEN>where
E: MatEl + PartialOrd,
impl<E, const LEN: usize> PartialOrd for Vector<E, LEN>where
E: MatEl + PartialOrd,
Source§impl<E, const LEN: usize> SubAssign for Vector<E, LEN>
impl<E, const LEN: usize> SubAssign for Vector<E, LEN>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreSource§impl<E, const N: usize> VectorIter<E, N> for Vector<E, N>where
E: MatEl,
impl<E, const N: usize> VectorIter<E, N> for Vector<E, N>where
E: MatEl,
fn vector_iter<'a>(&'a self) -> impl VectorIteratorRef<'a, &'a E>where
E: 'a,
Source§impl<E, const N: usize> VectorIterMut<E, N> for Vector<E, N>where
E: MatEl,
impl<E, const N: usize> VectorIterMut<E, N> for Vector<E, N>where
E: MatEl,
fn vector_iter_mut<'a>(&'a mut self) -> impl VectorIterator<'a, &'a mut E>where
E: 'a,
Source§impl<E, const N: usize> VectorMut<E, N> for Vector<E, N>where
E: MatEl,
impl<E, const N: usize> VectorMut<E, N> for Vector<E, N>where
E: MatEl,
Source§fn vector_mut(&mut self) -> &mut [E; N]
fn vector_mut(&mut self) -> &mut [E; N]
Returns a mutable reference to a fixed-size array from the collection. Read more
Source§impl<E, const N: usize> VectorRef<E, N> for Vector<E, N>where
E: MatEl,
impl<E, const N: usize> VectorRef<E, N> for Vector<E, N>where
E: MatEl,
Source§fn vector_ref(&self) -> &[E; N]
fn vector_ref(&self) -> &[E; N]
Returns a reference to a fixed-size array from the collection. Read more
impl<E, const LEN: usize> Copy for Vector<E, LEN>
impl<E, const LEN: usize> StructuralPartialEq for Vector<E, LEN>where
E: MatEl,
Auto Trait Implementations§
impl<E, const LEN: usize> Freeze for Vector<E, LEN>where
E: Freeze,
impl<E, const LEN: usize> RefUnwindSafe for Vector<E, LEN>where
E: RefUnwindSafe,
impl<E, const LEN: usize> Send for Vector<E, LEN>where
E: Send,
impl<E, const LEN: usize> Sync for Vector<E, LEN>where
E: Sync,
impl<E, const LEN: usize> Unpin for Vector<E, LEN>where
E: Unpin,
impl<E, const LEN: usize> UnwindSafe for Vector<E, LEN>where
E: 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