pub struct Vector<const C: usize, T> {
pub values: [T; C],
}Fields§
§values: [T; C]Implementations§
Source§impl<const C: usize, T> Vector<C, T>
impl<const C: usize, T> Vector<C, T>
pub fn elementwise_min(&self, rhs: Self) -> Self
pub fn elementwise_max(&self, rhs: Self) -> Self
Source§impl<const C: usize> Vector<C, f32>
impl<const C: usize> Vector<C, f32>
pub fn magn(&self) -> f32
pub fn normalized(&self) -> Self
Trait Implementations§
Source§impl<const C: usize, T: AddAssign + Copy> AddAssign for Vector<C, T>
impl<const C: usize, T: AddAssign + Copy> AddAssign for Vector<C, T>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl<'de, const C: usize, T: Deserialize<'de>> Deserialize<'de> for Vector<C, T>
Available on crate feature serde only.
impl<'de, const C: usize, T: Deserialize<'de>> Deserialize<'de> for Vector<C, T>
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<const C: usize, T> EuclideanDistanceSquared<Vector<C, T>, T> for Vector<C, T>
impl<const C: usize, T> EuclideanDistanceSquared<Vector<C, T>, T> for Vector<C, T>
fn euclidean_distance_squared(&self, other: &Self) -> T
Source§impl<const C: usize> IterateNeighbours<()> for Vector<C, i32>
impl<const C: usize> IterateNeighbours<()> for Vector<C, i32>
fn neighbours(&self, _context: &()) -> Vec<Self>
Source§impl<const C: usize> IterateNeighbours<()> for Vector<C, usize>
impl<const C: usize> IterateNeighbours<()> for Vector<C, usize>
fn neighbours(&self, _context: &()) -> Vec<Self>
Source§impl<const N: usize> LinearIndex<Vector<N, i128>> for Vector<N, i128>
impl<const N: usize> LinearIndex<Vector<N, i128>> for Vector<N, i128>
fn index_unchecked(&self, i: Self) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Self>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Self) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const N: usize> LinearIndex<Vector<N, i16>> for Vector<N, i16>
impl<const N: usize> LinearIndex<Vector<N, i16>> for Vector<N, i16>
fn index_unchecked(&self, i: Self) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Self>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Self) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const N: usize, T> LinearIndex<Vector<N, i32>> for ArrayNd<N, T>
impl<const N: usize, T> LinearIndex<Vector<N, i32>> for ArrayNd<N, T>
fn index_unchecked(&self, i: Vector<N, i32>) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Vector<N, i32>>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Vector<N, i32>) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const N: usize> LinearIndex<Vector<N, i32>> for Vector<N, i32>
impl<const N: usize> LinearIndex<Vector<N, i32>> for Vector<N, i32>
fn index_unchecked(&self, i: Self) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Self>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Self) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const N: usize> LinearIndex<Vector<N, i64>> for Vector<N, i64>
impl<const N: usize> LinearIndex<Vector<N, i64>> for Vector<N, i64>
fn index_unchecked(&self, i: Self) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Self>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Self) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const N: usize> LinearIndex<Vector<N, i8>> for Vector<N, i8>
impl<const N: usize> LinearIndex<Vector<N, i8>> for Vector<N, i8>
fn index_unchecked(&self, i: Self) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Self>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Self) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const N: usize> LinearIndex<Vector<N, isize>> for Vector<N, isize>
impl<const N: usize> LinearIndex<Vector<N, isize>> for Vector<N, isize>
fn index_unchecked(&self, i: Self) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Self>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Self) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const N: usize> LinearIndex<Vector<N, u128>> for Vector<N, u128>
impl<const N: usize> LinearIndex<Vector<N, u128>> for Vector<N, u128>
fn index_unchecked(&self, i: Self) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Self>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Self) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const N: usize> LinearIndex<Vector<N, u16>> for Vector<N, u16>
impl<const N: usize> LinearIndex<Vector<N, u16>> for Vector<N, u16>
fn index_unchecked(&self, i: Self) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Self>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Self) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const N: usize> LinearIndex<Vector<N, u32>> for Vector<N, u32>
impl<const N: usize> LinearIndex<Vector<N, u32>> for Vector<N, u32>
fn index_unchecked(&self, i: Self) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Self>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Self) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const N: usize> LinearIndex<Vector<N, u64>> for Vector<N, u64>
impl<const N: usize> LinearIndex<Vector<N, u64>> for Vector<N, u64>
fn index_unchecked(&self, i: Self) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Self>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Self) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const N: usize> LinearIndex<Vector<N, u8>> for Vector<N, u8>
impl<const N: usize> LinearIndex<Vector<N, u8>> for Vector<N, u8>
fn index_unchecked(&self, i: Self) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Self>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Self) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const N: usize, T> LinearIndex<Vector<N, usize>> for ArrayNd<N, T>
impl<const N: usize, T> LinearIndex<Vector<N, usize>> for ArrayNd<N, T>
fn index_unchecked(&self, i: Vector<N, usize>) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Vector<N, usize>>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Vector<N, usize>) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const N: usize> LinearIndex<Vector<N, usize>> for Vector<N, usize>
impl<const N: usize> LinearIndex<Vector<N, usize>> for Vector<N, usize>
fn index_unchecked(&self, i: Self) -> Option<usize>
fn unindex(&self, i: usize) -> Option<Self>
Source§unsafe fn cardinality(&self) -> Option<usize>
unsafe fn cardinality(&self) -> Option<usize>
👎Deprecated
This is unsafe and should not be called as overflows are not checked. Uses Iterator::product Read more
fn is_in_bounds(&self, i: &Self) -> bool
fn index(&self, i: I) -> Option<usize>
Source§impl<const C: usize, T> ManhattanDistance<Vector<C, T>, T> for Vector<C, T>
impl<const C: usize, T> ManhattanDistance<Vector<C, T>, T> for Vector<C, T>
fn manhattan_distance(&self, other: &Self) -> T
Source§impl<const C: usize, T: Copy + ModularAdd> ModularAdd for Vector<C, T>
impl<const C: usize, T: Copy + ModularAdd> ModularAdd for Vector<C, T>
Source§impl<const C: usize, T: Copy + ModularAddAssign> ModularAddAssign for Vector<C, T>
impl<const C: usize, T: Copy + ModularAddAssign> ModularAddAssign for Vector<C, T>
fn addassign_n(&mut self, rhs: Self, n: Self)
Source§impl<const C: usize, T> ModularDecompose<Vector<C, T>> for Vector<C, T>where
T: ModularDecompose<T> + Copy,
impl<const C: usize, T> ModularDecompose<Vector<C, T>> for Vector<C, T>where
T: ModularDecompose<T> + Copy,
Source§impl<const C: usize, T: Copy + ModularSub> ModularSub for Vector<C, T>
impl<const C: usize, T: Copy + ModularSub> ModularSub for Vector<C, T>
Source§impl<const C: usize, T: Copy + ModularSubAssign> ModularSubAssign for Vector<C, T>
impl<const C: usize, T: Copy + ModularSubAssign> ModularSubAssign for Vector<C, T>
fn subassign_n(&mut self, rhs: Self, n: Self)
Source§impl<T: Copy + Default + Add<Output = T> + Sub<Output = T> + Mul<Output = T>> Mul<Vector<3, T>> for Multivector3<T>
impl<T: Copy + Default + Add<Output = T> + Sub<Output = T> + Mul<Output = T>> Mul<Vector<3, T>> for Multivector3<T>
Source§impl<const C: usize, T: MulAssign + Copy> MulAssign<T> for Vector<C, T>
impl<const C: usize, T: MulAssign + Copy> MulAssign<T> for Vector<C, T>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moreSource§impl<const C: usize, T: Serialize> Serialize for Vector<C, T>
Available on crate feature serde only.
impl<const C: usize, T: Serialize> Serialize for Vector<C, T>
Available on crate feature
serde only.Source§impl<const C: usize, T: SubAssign + Copy> SubAssign for Vector<C, T>
impl<const C: usize, T: SubAssign + Copy> SubAssign for Vector<C, T>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl<const C: usize, T: Copy> Copy for Vector<C, T>
impl<const C: usize, T: Eq> Eq for Vector<C, T>
impl<const C: usize, T> StructuralPartialEq for Vector<C, T>
Auto Trait Implementations§
impl<const C: usize, T> Freeze for Vector<C, T>where
T: Freeze,
impl<const C: usize, T> RefUnwindSafe for Vector<C, T>where
T: RefUnwindSafe,
impl<const C: usize, T> Send for Vector<C, T>where
T: Send,
impl<const C: usize, T> Sync for Vector<C, T>where
T: Sync,
impl<const C: usize, T> Unpin for Vector<C, T>where
T: Unpin,
impl<const C: usize, T> UnwindSafe for Vector<C, 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