Trait array__ops::ArrayOps

source ·
pub trait ArrayOps<T, const N: usize>: Array + IntoIterator<Item = T> + Borrow<[T; N]> + BorrowMut<[T; N]> {
Show 147 methods // Required methods fn split_len(n: usize) -> (usize, usize); fn rsplit_len(n: usize) -> (usize, usize); fn split_ptr(&self, n: usize) -> (*const T, *const T); fn split_mut_ptr(&mut self, n: usize) -> (*mut T, *mut T); fn rsplit_ptr(&self, n: usize) -> (*const T, *const T); fn rsplit_mut_ptr(&mut self, n: usize) -> (*mut T, *mut T); fn fill<F>(fill: F) -> Self where F: FnMut(usize) -> T; fn rfill<F>(fill: F) -> Self where F: FnMut(usize) -> T; fn fill_boxed<F>(fill: F) -> Box<Self> where F: FnMut(usize) -> T; fn rfill_boxed<F>(fill: F) -> Box<Self> where F: FnMut(usize) -> T; fn fill_boxed_in<F, A>(fill: F, alloc: A) -> Box<Self, A> where F: FnMut(usize) -> T, A: Allocator; fn rfill_boxed_in<F, A>(fill: F, alloc: A) -> Box<Self, A> where F: FnMut(usize) -> T, A: Allocator; fn truncate<const M: usize>(self) -> [T; M] where T:, [(); { _ }]:; fn rtruncate<const M: usize>(self) -> [T; M] where T:, [(); { _ }]:; fn truncate_ref<const M: usize>(&self) -> &[T; M] where [(); { _ }]:; fn rtruncate_ref<const M: usize>(&self) -> &[T; M] where [(); { _ }]:; fn truncate_mut<const M: usize>(&mut self) -> &mut [T; M] where [(); { _ }]:; fn rtruncate_mut<const M: usize>(&mut self) -> &mut [T; M] where [(); { _ }]:; fn resize<const M: usize, F>(self, fill: F) -> [T; M] where F: FnMut(usize) -> T, T:; fn rresize<const M: usize, F>(self, fill: F) -> [T; M] where F: FnMut(usize) -> T, T:; fn extend<const M: usize, F>(self, fill: F) -> [T; M] where F: FnMut(usize) -> T, [(); { _ }]:; fn rextend<const M: usize, F>(self, fill: F) -> [T; M] where F: FnMut(usize) -> T, [(); { _ }]:; fn reformulate_length<const M: usize>(self) -> [T; M] where [(); { _ }]:; fn reformulate_length_ref<const M: usize>(&self) -> &[T; M] where [(); { _ }]:; fn reformulate_length_mut<const M: usize>(&mut self) -> &mut [T; M] where [(); { _ }]:; fn try_reformulate_length<const M: usize>(self) -> Result<[T; M], Self>; fn try_reformulate_length_ref<const M: usize>(&self) -> Option<&[T; M]>; fn try_reformulate_length_mut<const M: usize>( &mut self ) -> Option<&mut [T; M]>; fn into_collumn(self) -> [[T; 1]; N]; fn as_collumn(&self) -> &[[T; 1]; N]; fn as_collumn_mut(&mut self) -> &mut [[T; 1]; N]; fn map2<Map>(self, map: Map) -> [Map::Output; N] where Map: FnMut<(T,)>; fn map_outer<Map>(&self, map: Map) -> [[Map::Output; N]; N] where Map: FnMut<(T, T)>, T: Copy; fn comap<Map, Rhs>(self, rhs: [Rhs; N], map: Map) -> [Map::Output; N] where Map: FnMut<(T, Rhs)>; fn comap_outer<Map, Rhs, const M: usize>( &self, rhs: &[Rhs; M], map: Map ) -> [[Map::Output; M]; N] where Map: FnMut<(T, Rhs)>, T: Copy, Rhs: Copy; fn flat_map<Map, O, const M: usize>(self, map: Map) -> [O; { _ }] where Map: FnMut<(T,), Output = [O; M]>; fn map_assign<Map>(&mut self, map: Map) where Map: FnMut(T) -> T; fn zip<Z>(self, other: [Z; N]) -> [(T, Z); N]; fn zip_outer<Z, const M: usize>(&self, other: &[Z; M]) -> [[(T, Z); M]; N] where T: Copy, Z: Copy; fn enumerate(self) -> [(usize, T); N]; fn diagonal<const H: usize, const W: usize>(self) -> [[T; W]; H] where T: Default + Copy, [(); { _ }]:; fn differentiate(&mut self) where T: SubAssign<T> + Copy; fn integrate(&mut self) where T: AddAssign<T> + Copy; fn reduce<R>(self, reduce: R) -> Option<T> where R: FnMut(T, T) -> T; fn try_sum(self) -> Option<T> where T: AddAssign; fn sum_from<S>(self, from: S) -> S where S: AddAssign<T>; fn try_product(self) -> Option<T> where T: MulAssign; fn product_from<P>(self, from: P) -> P where P: MulAssign<T>; fn max(self) -> Option<T> where T: Ord; fn min(self) -> Option<T> where T: Ord; fn first_max(self) -> Option<T> where T: PartialOrd<T>; fn first_min(self) -> Option<T> where T: PartialOrd<T>; fn argmax(&self) -> Option<usize> where T: PartialOrd<T>; fn argmin(&self) -> Option<usize> where T: PartialOrd<T>; fn add_all<Rhs>(self, rhs: Rhs) -> [<T as Add<Rhs>>::Output; N] where T: Add<Rhs>, Rhs: Copy; fn sub_all<Rhs>(self, rhs: Rhs) -> [<T as Sub<Rhs>>::Output; N] where T: Sub<Rhs>, Rhs: Copy; fn mul_all<Rhs>(self, rhs: Rhs) -> [<T as Mul<Rhs>>::Output; N] where T: Mul<Rhs>, Rhs: Copy; fn div_all<Rhs>(self, rhs: Rhs) -> [<T as Div<Rhs>>::Output; N] where T: Div<Rhs>, Rhs: Copy; fn rem_all<Rhs>(self, rhs: Rhs) -> [<T as Rem<Rhs>>::Output; N] where T: Rem<Rhs>, Rhs: Copy; fn shl_all<Rhs>(self, rhs: Rhs) -> [<T as Shl<Rhs>>::Output; N] where T: Shl<Rhs>, Rhs: Copy; fn shr_all<Rhs>(self, rhs: Rhs) -> [<T as Shr<Rhs>>::Output; N] where T: Shr<Rhs>, Rhs: Copy; fn bitor_all<Rhs>(self, rhs: Rhs) -> [<T as BitOr<Rhs>>::Output; N] where T: BitOr<Rhs>, Rhs: Copy; fn bitand_all<Rhs>(self, rhs: Rhs) -> [<T as BitAnd<Rhs>>::Output; N] where T: BitAnd<Rhs>, Rhs: Copy; fn bitxor_all<Rhs>(self, rhs: Rhs) -> [<T as BitXor<Rhs>>::Output; N] where T: BitXor<Rhs>, Rhs: Copy; fn add_assign_all<Rhs>(&mut self, rhs: Rhs) where T: AddAssign<Rhs>, Rhs: Copy; fn sub_assign_all<Rhs>(&mut self, rhs: Rhs) where T: SubAssign<Rhs>, Rhs: Copy; fn mul_assign_all<Rhs>(&mut self, rhs: Rhs) where T: MulAssign<Rhs>, Rhs: Copy; fn div_assign_all<Rhs>(&mut self, rhs: Rhs) where T: DivAssign<Rhs>, Rhs: Copy; fn rem_assign_all<Rhs>(&mut self, rhs: Rhs) where T: RemAssign<Rhs>, Rhs: Copy; fn shl_assign_all<Rhs>(&mut self, rhs: Rhs) where T: ShlAssign<Rhs>, Rhs: Copy; fn shr_assign_all<Rhs>(&mut self, rhs: Rhs) where T: ShrAssign<Rhs>, Rhs: Copy; fn bitor_assign_all<Rhs>(&mut self, rhs: Rhs) where T: BitOrAssign<Rhs>, Rhs: Copy; fn bitand_assign_all<Rhs>(&mut self, rhs: Rhs) where T: BitAndAssign<Rhs>, Rhs: Copy; fn bitxor_assign_all<Rhs>(&mut self, rhs: Rhs) where T: BitXorAssign<Rhs>, Rhs: Copy; fn add_all_neg<Rhs>(self, rhs: Rhs) -> [<Rhs as Sub<T>>::Output; N] where Rhs: Copy + Sub<T>; fn mul_all_inv<Rhs>(self, rhs: Rhs) -> [<Rhs as Div<T>>::Output; N] where Rhs: Copy + Div<T>; fn neg_all(self) -> [<T as Neg>::Output; N] where T: Neg; fn neg_assign_all(&mut self) where T: Neg<Output = T>; fn add_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Add<Rhs>>::Output; N] where T: Add<Rhs>; fn sub_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Sub<Rhs>>::Output; N] where T: Sub<Rhs>; fn mul_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Mul<Rhs>>::Output; N] where T: Mul<Rhs>; fn div_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Div<Rhs>>::Output; N] where T: Div<Rhs>; fn rem_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Rem<Rhs>>::Output; N] where T: Rem<Rhs>; fn shl_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Shl<Rhs>>::Output; N] where T: Shl<Rhs>; fn shr_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Shr<Rhs>>::Output; N] where T: Shr<Rhs>; fn bitor_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as BitOr<Rhs>>::Output; N] where T: BitOr<Rhs>; fn bitand_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as BitAnd<Rhs>>::Output; N] where T: BitAnd<Rhs>; fn bitxor_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as BitXor<Rhs>>::Output; N] where T: BitXor<Rhs>; fn add_assign_each<Rhs>(&mut self, rhs: [Rhs; N]) where T: AddAssign<Rhs>; fn sub_assign_each<Rhs>(&mut self, rhs: [Rhs; N]) where T: SubAssign<Rhs>; fn mul_assign_each<Rhs>(&mut self, rhs: [Rhs; N]) where T: MulAssign<Rhs>; fn div_assign_each<Rhs>(&mut self, rhs: [Rhs; N]) where T: DivAssign<Rhs>; fn rem_assign_each<Rhs>(&mut self, rhs: [Rhs; N]) where T: RemAssign<Rhs>; fn shl_assign_each<Rhs>(&mut self, rhs: [Rhs; N]) where T: ShlAssign<Rhs>; fn shr_assign_each<Rhs>(&mut self, rhs: [Rhs; N]) where T: ShrAssign<Rhs>; fn bitor_assign_each<Rhs>(&mut self, rhs: [Rhs; N]) where T: BitOrAssign<Rhs>; fn bitand_assign_each<Rhs>(&mut self, rhs: [Rhs; N]) where T: BitAndAssign<Rhs>; fn bitxor_assign_each<Rhs>(&mut self, rhs: [Rhs; N]) where T: BitXorAssign<Rhs>; fn try_mul_dot<Rhs>(self, rhs: [Rhs; N]) -> Option<<T as Mul<Rhs>>::Output> where T: Mul<Rhs, Output: AddAssign>; fn mul_dot_bias<Rhs>( self, rhs: [Rhs; N], bias: <T as Mul<Rhs>>::Output ) -> <T as Mul<Rhs>>::Output where T: Mul<Rhs, Output: AddAssign>; fn mul_outer<Rhs, const M: usize>( &self, rhs: &[Rhs; M] ) -> [[<T as Mul<Rhs>>::Output; M]; N] where T: Mul<Rhs> + Copy, Rhs: Copy; fn mul_cross<Rhs>(&self, rhs: [&[Rhs; N]; { _ }]) -> [<T as Sub>::Output; N] where T: MulAssign<Rhs> + Sub + Copy, Rhs: Copy; fn try_magnitude_squared(self) -> Option<<T as Mul<T>>::Output> where T: Mul<T, Output: AddAssign> + Copy; fn chain<const M: usize>(self, rhs: [T; M]) -> [T; { _ }]; fn rchain<const M: usize>(self, rhs: [T; M]) -> [T; { _ }]; fn into_rotate_left(self, n: usize) -> Self; fn into_rotate_right(self, n: usize) -> Self; fn into_shift_many_left<const M: usize>( self, items: [T; M] ) -> ([T; M], Self); fn into_shift_many_right<const M: usize>( self, items: [T; M] ) -> (Self, [T; M]); fn into_shift_left(self, item: T) -> (T, Self); fn into_shift_right(self, item: T) -> (Self, T); fn rotate_left2(&mut self, n: usize); fn rotate_right2(&mut self, n: usize); fn shift_many_left<const M: usize>(&mut self, items: [T; M]) -> [T; M]; fn shift_many_right<const M: usize>(&mut self, items: [T; M]) -> [T; M]; fn shift_left(&mut self, item: T) -> T; fn shift_right(&mut self, item: T) -> T; fn spread<const M: usize>(self) -> ([[T; { _ }]; M], [T; { _ }]) where [(); { _ }]:; fn spread_ref<const M: usize>( &self ) -> ([&[Padded<T, M>; { _ }]; M], &[T; { _ }]) where [(); { _ }]:; fn spread_mut<const M: usize>( &mut self ) -> ([&mut [Padded<T, M>; { _ }]; M], &mut [T; { _ }]) where [(); { _ }]:; fn rspread<const M: usize>(self) -> ([T; { _ }], [[T; { _ }]; M]) where [(); { _ }]:, T: Copy; fn rspread_ref<const M: usize>( &self ) -> (&[T; { _ }], [&[Padded<T, M>; { _ }]; M]) where [(); { _ }]:; fn rspread_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], [&mut [Padded<T, M>; { _ }]; M]) where [(); { _ }]:; fn spread_exact<const M: usize>(self) -> [[T; { _ }]; M] where [(); { _ }]:; fn spread_exact_ref<const M: usize>(&self) -> [&[Padded<T, M>; { _ }]; M] where [(); { _ }]:; fn spread_exact_mut<const M: usize>( &mut self ) -> [&mut [Padded<T, M>; { _ }]; M] where [(); { _ }]:; fn chunks<const M: usize>(self) -> ([[T; M]; { _ }], [T; { _ }]) where [(); { _ }]:; fn chunks_ref<const M: usize>(&self) -> (&[[T; M]; { _ }], &[T; { _ }]) where [(); { _ }]:; fn chunks_mut<const M: usize>( &mut self ) -> (&mut [[T; M]; { _ }], &mut [T; { _ }]) where [(); { _ }]:; fn rchunks<const M: usize>(self) -> ([T; { _ }], [[T; M]; { _ }]) where [(); { _ }]:; fn rchunks_ref<const M: usize>(&self) -> (&[T; { _ }], &[[T; M]; { _ }]) where [(); { _ }]:; fn rchunks_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [[T; M]; { _ }]) where [(); { _ }]:; fn chunks_exact<const M: usize>(self) -> [[T; M]; { _ }] where [(); { _ }]:; fn chunks_exact_ref<const M: usize>(&self) -> &[[T; M]; { _ }] where [(); { _ }]:; fn chunks_exact_mut<const M: usize>(&mut self) -> &mut [[T; M]; { _ }] where [(); { _ }]:; fn array_simd<const M: usize>(self) -> ([Simd<T, M>; { _ }], [T; { _ }]) where T: SimdElement, LaneCount<M>: SupportedLaneCount, [(); { _ }]:; fn array_rsimd<const M: usize>(self) -> ([T; { _ }], [Simd<T, M>; { _ }]) where T: SimdElement, LaneCount<M>: SupportedLaneCount, [(); { _ }]:; fn array_simd_exact<const M: usize>(self) -> [Simd<T, M>; { _ }] where T: SimdElement, LaneCount<M>: SupportedLaneCount, [(); { _ }]:; fn split_array<const M: usize>(self) -> ([T; M], [T; { _ }]) where [(); { _ }]:; fn split_array_ref2<const M: usize>(&self) -> (&[T; M], &[T; { _ }]) where [(); { _ }]:; fn split_array_mut2<const M: usize>( &mut self ) -> (&mut [T; M], &mut [T; { _ }]) where [(); { _ }]:; fn rsplit_array<const M: usize>(self) -> ([T; { _ }], [T; M]) where [(); { _ }]:; fn rsplit_array_ref2<const M: usize>(&self) -> (&[T; { _ }], &[T; M]) where [(); { _ }]:; fn rsplit_array_mut2<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [T; M]) where [(); { _ }]:; fn each_ref2(&self) -> [&T; N]; fn each_mut2(&mut self) -> [&mut T; N]; fn bit_reverse_permutation(&mut self) where [(); { _ }]:;
}

Required Methods§

source

fn split_len(n: usize) -> (usize, usize)

source

fn rsplit_len(n: usize) -> (usize, usize)

source

fn split_ptr(&self, n: usize) -> (*const T, *const T)

source

fn split_mut_ptr(&mut self, n: usize) -> (*mut T, *mut T)

source

fn rsplit_ptr(&self, n: usize) -> (*const T, *const T)

source

fn rsplit_mut_ptr(&mut self, n: usize) -> (*mut T, *mut T)

source

fn fill<F>(fill: F) -> Self
where F: FnMut(usize) -> T,

source

fn rfill<F>(fill: F) -> Self
where F: FnMut(usize) -> T,

source

fn fill_boxed<F>(fill: F) -> Box<Self>
where F: FnMut(usize) -> T,

source

fn rfill_boxed<F>(fill: F) -> Box<Self>
where F: FnMut(usize) -> T,

source

fn fill_boxed_in<F, A>(fill: F, alloc: A) -> Box<Self, A>
where F: FnMut(usize) -> T, A: Allocator,

source

fn rfill_boxed_in<F, A>(fill: F, alloc: A) -> Box<Self, A>
where F: FnMut(usize) -> T, A: Allocator,

source

fn truncate<const M: usize>(self) -> [T; M]
where T:, [(); { _ }]:,

source

fn rtruncate<const M: usize>(self) -> [T; M]
where T:, [(); { _ }]:,

source

fn truncate_ref<const M: usize>(&self) -> &[T; M]
where [(); { _ }]:,

source

fn rtruncate_ref<const M: usize>(&self) -> &[T; M]
where [(); { _ }]:,

source

fn truncate_mut<const M: usize>(&mut self) -> &mut [T; M]
where [(); { _ }]:,

source

fn rtruncate_mut<const M: usize>(&mut self) -> &mut [T; M]
where [(); { _ }]:,

source

fn resize<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T, T:,

source

fn rresize<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T, T:,

source

fn extend<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T, [(); { _ }]:,

source

fn rextend<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T, [(); { _ }]:,

source

fn reformulate_length<const M: usize>(self) -> [T; M]
where [(); { _ }]:,

source

fn reformulate_length_ref<const M: usize>(&self) -> &[T; M]
where [(); { _ }]:,

source

fn reformulate_length_mut<const M: usize>(&mut self) -> &mut [T; M]
where [(); { _ }]:,

source

fn try_reformulate_length<const M: usize>(self) -> Result<[T; M], Self>

source

fn try_reformulate_length_ref<const M: usize>(&self) -> Option<&[T; M]>

source

fn try_reformulate_length_mut<const M: usize>(&mut self) -> Option<&mut [T; M]>

source

fn into_collumn(self) -> [[T; 1]; N]

source

fn as_collumn(&self) -> &[[T; 1]; N]

source

fn as_collumn_mut(&mut self) -> &mut [[T; 1]; N]

source

fn map2<Map>(self, map: Map) -> [Map::Output; N]
where Map: FnMut<(T,)>,

Maps all values of an array with a given function.

§Example
use array__ops::*;
 
const A: [u8; 4] = [1, 2, 3, 4];
let b = A.map2(|b| -(b as i8));
 
assert_eq!(b, [-1, -2, -3, -4]);
source

fn map_outer<Map>(&self, map: Map) -> [[Map::Output; N]; N]
where Map: FnMut<(T, T)>, T: Copy,

source

fn comap<Map, Rhs>(self, rhs: [Rhs; N], map: Map) -> [Map::Output; N]
where Map: FnMut<(T, Rhs)>,

source

fn comap_outer<Map, Rhs, const M: usize>( &self, rhs: &[Rhs; M], map: Map ) -> [[Map::Output; M]; N]
where Map: FnMut<(T, Rhs)>, T: Copy, Rhs: Copy,

source

fn flat_map<Map, O, const M: usize>(self, map: Map) -> [O; { _ }]
where Map: FnMut<(T,), Output = [O; M]>,

source

fn map_assign<Map>(&mut self, map: Map)
where Map: FnMut(T) -> T,

source

fn zip<Z>(self, other: [Z; N]) -> [(T, Z); N]

Combines two arrays with possibly different items into parallel, where each element lines up in the same position.

This method can be executed at compile-time, as opposed to the standard-library method.

§Example
use array__ops::*;
 
const A: [u8; 4] = [4, 3, 2, 1];
const B: [&str; 4] = ["four", "three", "two", "one"];
let c = A.zip(B);
 
assert_eq!(c, [(4, "four"), (3, "three"), (2, "two"), (1, "one")]);
source

fn zip_outer<Z, const M: usize>(&self, other: &[Z; M]) -> [[(T, Z); M]; N]
where T: Copy, Z: Copy,

source

fn enumerate(self) -> [(usize, T); N]

source

fn diagonal<const H: usize, const W: usize>(self) -> [[T; W]; H]
where T: Default + Copy, [(); { _ }]:,

source

fn differentiate(&mut self)
where T: SubAssign<T> + Copy,

Differentiates array (discrete calculus)

§Example
use array__ops::*;
 
let mut a = [1, 2, 3];
 
a.differentiate();
 
assert_eq!(a, [1, 2 - 1, 3 - 2]);
source

fn integrate(&mut self)
where T: AddAssign<T> + Copy,

Integrates array (discrete calculus)

§Example
use array__ops::*;
 
let mut a = [1, 2, 3];
 
a.integrate();
 
assert_eq!(a, [1, 1 + 2, 1 + 2 + 3])
source

fn reduce<R>(self, reduce: R) -> Option<T>
where R: FnMut(T, T) -> T,

Reduces elements in array into one element, using a given operand

§Example
use array__ops::ArrayOps;
 
const A: [u8; 3] = [1, 2, 3];
 
let r: u8 = A.reduce(|a, b| a + b).unwrap();
 
assert_eq!(r, 6);
source

fn try_sum(self) -> Option<T>
where T: AddAssign,

source

fn sum_from<S>(self, from: S) -> S
where S: AddAssign<T>,

source

fn try_product(self) -> Option<T>
where T: MulAssign,

source

fn product_from<P>(self, from: P) -> P
where P: MulAssign<T>,

source

fn max(self) -> Option<T>
where T: Ord,

source

fn min(self) -> Option<T>
where T: Ord,

source

fn first_max(self) -> Option<T>
where T: PartialOrd<T>,

source

fn first_min(self) -> Option<T>
where T: PartialOrd<T>,

source

fn argmax(&self) -> Option<usize>
where T: PartialOrd<T>,

source

fn argmin(&self) -> Option<usize>
where T: PartialOrd<T>,

source

fn add_all<Rhs>(self, rhs: Rhs) -> [<T as Add<Rhs>>::Output; N]
where T: Add<Rhs>, Rhs: Copy,

source

fn sub_all<Rhs>(self, rhs: Rhs) -> [<T as Sub<Rhs>>::Output; N]
where T: Sub<Rhs>, Rhs: Copy,

source

fn mul_all<Rhs>(self, rhs: Rhs) -> [<T as Mul<Rhs>>::Output; N]
where T: Mul<Rhs>, Rhs: Copy,

source

fn div_all<Rhs>(self, rhs: Rhs) -> [<T as Div<Rhs>>::Output; N]
where T: Div<Rhs>, Rhs: Copy,

source

fn rem_all<Rhs>(self, rhs: Rhs) -> [<T as Rem<Rhs>>::Output; N]
where T: Rem<Rhs>, Rhs: Copy,

source

fn shl_all<Rhs>(self, rhs: Rhs) -> [<T as Shl<Rhs>>::Output; N]
where T: Shl<Rhs>, Rhs: Copy,

source

fn shr_all<Rhs>(self, rhs: Rhs) -> [<T as Shr<Rhs>>::Output; N]
where T: Shr<Rhs>, Rhs: Copy,

source

fn bitor_all<Rhs>(self, rhs: Rhs) -> [<T as BitOr<Rhs>>::Output; N]
where T: BitOr<Rhs>, Rhs: Copy,

source

fn bitand_all<Rhs>(self, rhs: Rhs) -> [<T as BitAnd<Rhs>>::Output; N]
where T: BitAnd<Rhs>, Rhs: Copy,

source

fn bitxor_all<Rhs>(self, rhs: Rhs) -> [<T as BitXor<Rhs>>::Output; N]
where T: BitXor<Rhs>, Rhs: Copy,

source

fn add_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: AddAssign<Rhs>, Rhs: Copy,

source

fn sub_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: SubAssign<Rhs>, Rhs: Copy,

source

fn mul_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: MulAssign<Rhs>, Rhs: Copy,

source

fn div_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: DivAssign<Rhs>, Rhs: Copy,

source

fn rem_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: RemAssign<Rhs>, Rhs: Copy,

source

fn shl_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: ShlAssign<Rhs>, Rhs: Copy,

source

fn shr_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: ShrAssign<Rhs>, Rhs: Copy,

source

fn bitor_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: BitOrAssign<Rhs>, Rhs: Copy,

source

fn bitand_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: BitAndAssign<Rhs>, Rhs: Copy,

source

fn bitxor_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: BitXorAssign<Rhs>, Rhs: Copy,

source

fn add_all_neg<Rhs>(self, rhs: Rhs) -> [<Rhs as Sub<T>>::Output; N]
where Rhs: Copy + Sub<T>,

source

fn mul_all_inv<Rhs>(self, rhs: Rhs) -> [<Rhs as Div<T>>::Output; N]
where Rhs: Copy + Div<T>,

source

fn neg_all(self) -> [<T as Neg>::Output; N]
where T: Neg,

source

fn neg_assign_all(&mut self)
where T: Neg<Output = T>,

source

fn add_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Add<Rhs>>::Output; N]
where T: Add<Rhs>,

source

fn sub_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Sub<Rhs>>::Output; N]
where T: Sub<Rhs>,

source

fn mul_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Mul<Rhs>>::Output; N]
where T: Mul<Rhs>,

source

fn div_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Div<Rhs>>::Output; N]
where T: Div<Rhs>,

source

fn rem_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Rem<Rhs>>::Output; N]
where T: Rem<Rhs>,

source

fn shl_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Shl<Rhs>>::Output; N]
where T: Shl<Rhs>,

source

fn shr_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Shr<Rhs>>::Output; N]
where T: Shr<Rhs>,

source

fn bitor_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as BitOr<Rhs>>::Output; N]
where T: BitOr<Rhs>,

source

fn bitand_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as BitAnd<Rhs>>::Output; N]
where T: BitAnd<Rhs>,

source

fn bitxor_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as BitXor<Rhs>>::Output; N]
where T: BitXor<Rhs>,

source

fn add_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: AddAssign<Rhs>,

source

fn sub_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: SubAssign<Rhs>,

source

fn mul_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: MulAssign<Rhs>,

source

fn div_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: DivAssign<Rhs>,

source

fn rem_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: RemAssign<Rhs>,

source

fn shl_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: ShlAssign<Rhs>,

source

fn shr_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: ShrAssign<Rhs>,

source

fn bitor_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: BitOrAssign<Rhs>,

source

fn bitand_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: BitAndAssign<Rhs>,

source

fn bitxor_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: BitXorAssign<Rhs>,

source

fn try_mul_dot<Rhs>(self, rhs: [Rhs; N]) -> Option<<T as Mul<Rhs>>::Output>
where T: Mul<Rhs, Output: AddAssign>,

source

fn mul_dot_bias<Rhs>( self, rhs: [Rhs; N], bias: <T as Mul<Rhs>>::Output ) -> <T as Mul<Rhs>>::Output
where T: Mul<Rhs, Output: AddAssign>,

source

fn mul_outer<Rhs, const M: usize>( &self, rhs: &[Rhs; M] ) -> [[<T as Mul<Rhs>>::Output; M]; N]
where T: Mul<Rhs> + Copy, Rhs: Copy,

source

fn mul_cross<Rhs>(&self, rhs: [&[Rhs; N]; { _ }]) -> [<T as Sub>::Output; N]
where T: MulAssign<Rhs> + Sub + Copy, Rhs: Copy,

Computes the general cross-product of the two arrays (as if vectors, in the mathematical sense).

§Example
#![feature(generic_const_exprs)]
 
use array__ops::*;
 
const U: [f64; 3] = [1.0, 0.0, 0.0];
const V: [f64; 3] = [0.0, 1.0, 0.0];
 
let w = U.mul_cross([&V]);
 
assert_eq!(w, [0.0, 0.0, 1.0]);
source

fn try_magnitude_squared(self) -> Option<<T as Mul<T>>::Output>
where T: Mul<T, Output: AddAssign> + Copy,

source

fn chain<const M: usize>(self, rhs: [T; M]) -> [T; { _ }]

Chains two arrays with the same item together.

§Example
use array__ops::*;
 
let a = ["one", "two"];
let b = ["three"];
 
assert_eq!(a.chain(b), ["one", "two", "three"]);
source

fn rchain<const M: usize>(self, rhs: [T; M]) -> [T; { _ }]

Chains two arrays with the same item together in reverse.

§Example
use array__ops::*;
 
let a = ["two", "three"];
let b = ["one"];
 
assert_eq!(a.rchain(b), ["one", "two", "three"]);
source

fn into_rotate_left(self, n: usize) -> Self

source

fn into_rotate_right(self, n: usize) -> Self

source

fn into_shift_many_left<const M: usize>(self, items: [T; M]) -> ([T; M], Self)

source

fn into_shift_many_right<const M: usize>(self, items: [T; M]) -> (Self, [T; M])

source

fn into_shift_left(self, item: T) -> (T, Self)

source

fn into_shift_right(self, item: T) -> (Self, T)

source

fn rotate_left2(&mut self, n: usize)

source

fn rotate_right2(&mut self, n: usize)

source

fn shift_many_left<const M: usize>(&mut self, items: [T; M]) -> [T; M]

source

fn shift_many_right<const M: usize>(&mut self, items: [T; M]) -> [T; M]

source

fn shift_left(&mut self, item: T) -> T

source

fn shift_right(&mut self, item: T) -> T

source

fn spread<const M: usize>(self) -> ([[T; { _ }]; M], [T; { _ }])
where [(); { _ }]:,

Distributes items of an array equally across a given width, then provides the rest as a separate array.

§Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array__ops::*;
 
let array = ["ping 1", "pong 1", "ping 2", "pong 2", "ping 3", "pong 3", "uhh..."];
 
let ([ping, pong], rest) = array.spread::<2>();
 
assert_eq!(ping, ["ping 1", "ping 2", "ping 3"]);
assert_eq!(pong, ["pong 1", "pong 2", "pong 3"]);
assert_eq!(rest, ["uhh..."]);
source

fn spread_ref<const M: usize>( &self ) -> ([&[Padded<T, M>; { _ }]; M], &[T; { _ }])
where [(); { _ }]:,

Distributes items of an array-slice equally across a given width, then provides the rest as a separate array-slice.

The spread-out slices are given in padded arrays. Each padded item can be borrowed into a reference to the array’s item.

source

fn spread_mut<const M: usize>( &mut self ) -> ([&mut [Padded<T, M>; { _ }]; M], &mut [T; { _ }])
where [(); { _ }]:,

Distributes items of a mutable array-slice equally across a given width, then provides the rest as a separate mutable array-slice.

The spread-out slices are given in padded arrays. Each padded item can be borrowed into a reference to the array’s item.

§Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array__ops::*;
 
let mut array = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"];
 
let (threes, _) = array.spread_mut::<3>();
 
for fizz in threes.into_iter().last().unwrap()
{
    **fizz = "fizz";
}
 
let (fives, _) = array.spread_mut::<5>();
 
for buzz in fives.into_iter().last().unwrap()
{
    **buzz = "buzz";
}
 
let (fifteens, _) = array.spread_mut::<15>();
 
for fizzbuzz in fifteens.into_iter().last().unwrap()
{
    **fizzbuzz = "fizzbuzz";
}
 
assert_eq!(array, ["1", "2", "fizz", "4", "buzz", "fizz", "7", "8", "fizz", "buzz", "11", "fizz", "13", "14", "fizzbuzz", "16", "17", "fizz", "19", "buzz"]);
 
source

fn rspread<const M: usize>(self) -> ([T; { _ }], [[T; { _ }]; M])
where [(); { _ }]:, T: Copy,

Distributes items of an array equally across a given width, then provides the leftmost rest as a separate array.

source

fn rspread_ref<const M: usize>( &self ) -> (&[T; { _ }], [&[Padded<T, M>; { _ }]; M])
where [(); { _ }]:,

Distributes items of an array-slice equally across a given width, then provides the leftmost rest as a separate array-slice.

The spread-out slices are given in padded arrays. Each padded item can be borrowed into a reference to the array’s item.

§Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
#![feature(array_methods)]
 
use array__ops::*;
 
let array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
 
let (zero, [odd, even]) = array.rspread_ref::<2>();
 
assert_eq!(*zero, [0]);
assert_eq!(odd.each_ref().map(|padding| **padding), [1, 3, 5, 7, 9, 11, 13, 15, 17, 19]);
assert_eq!(even.each_ref().map(|padding| **padding), [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]);
source

fn rspread_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], [&mut [Padded<T, M>; { _ }]; M])
where [(); { _ }]:,

Distributes items of a mutable array-slice equally across a given width, then provides the leftmost rest as a separate mutable array-slice.

The spread-out slices are given in padded arrays. Each padded item can be borrowed into a reference to the array’s item.

§Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
#![feature(array_methods)]
 
use array__ops::*;
 
let mut array = ["the", "beat", "goes", "1", "2", "3", "4", "5", "6", "7", "8"];
 
let (start, [boots, n, cats, and]) = array.rspread_mut::<4>();
 
for boots in boots
{
    **boots = "boots";
}
for n in n
{
    **n = "n";
}
for cats in cats
{
    **cats = "cats";
}
for and in and
{
    **and = "and";
}
 
assert_eq!(array, ["the", "beat", "goes", "boots", "n", "cats", "and", "boots", "n", "cats", "and"]);
source

fn spread_exact<const M: usize>(self) -> [[T; { _ }]; M]
where [(); { _ }]:,

Distributes items of an array equally across a given width, with no rest.

The width must be a factor of the array length, otherwise it will not compile.

§Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array__ops::*;
 
let array = *b"aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ";
 
let [lower_case, upper_case] = array.spread_exact::<2>();
 
assert_eq!(lower_case, *b"abcdefghijklmnopqrstuvwxyz");
assert_eq!(upper_case, *b"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
source

fn spread_exact_ref<const M: usize>(&self) -> [&[Padded<T, M>; { _ }]; M]
where [(); { _ }]:,

Distributes items of an array-slice equally across a given width, with no rest.

The width must be a factor of the array length, otherwise it will not compile.

The spread-out slices are given in padded arrays. Each padded item can be borrowed into a reference to the array’s item.

§Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
#![feature(array_methods)]
 
use array__ops::*;
 
let statement = ["s", "he", "be", "lie", "ve", "d"];
 
let [interpretation2, interpretation1] = statement.spread_exact_ref::<2>();
 
assert_eq!(interpretation1, &["he", "lie", "d"]);
assert_eq!(interpretation2, &["s", "be", "ve"]);
source

fn spread_exact_mut<const M: usize>( &mut self ) -> [&mut [Padded<T, M>; { _ }]; M]
where [(); { _ }]:,

Distributes items of a mutable array-slice equally across a given width, with no rest.

The width must be a factor of the array length, otherwise it will not compile.

The spread-out slices are given in padded arrays. Each padded item can be borrowed into a reference to the array’s item.

§Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
#![feature(array_methods)]
 
use array__ops::*;
 
let mut array = *b"aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ";
 
let [lower_case, upper_case] = array.spread_exact_mut::<2>();
 
assert_eq!(lower_case.each_ref().map(|padding| padding.borrow()), b"abcdefghijklmnopqrstuvwxyz".each_ref());
assert_eq!(upper_case.each_ref().map(|padding| padding.borrow()), b"ABCDEFGHIJKLMNOPQRSTUVWXYZ".each_ref());
 
for c in upper_case
{
    **c = b'_';
}
 
assert_eq!(array, *b"a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_")
source

fn chunks<const M: usize>(self) -> ([[T; M]; { _ }], [T; { _ }])
where [(); { _ }]:,

Divides an array into chunks, then yielding the rest in a separate array.

§Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array__ops::*;
 
let array = ["carrot", "potato", "beet", "tomato", "kiwi", "banana", "cherry", "peach", "strawberry", "nine volt batteries"];
 
let ([root_vegetables, technically_berries, stone_fruits], not_for_human_consumption) = array.chunks::<3>();
 
assert_eq!(root_vegetables, ["carrot", "potato", "beet"]);
assert_eq!(technically_berries, ["tomato", "kiwi", "banana"]);
assert_eq!(stone_fruits, ["cherry", "peach", "strawberry"]);
assert_eq!(not_for_human_consumption, ["nine volt batteries"]);
source

fn chunks_ref<const M: usize>(&self) -> (&[[T; M]; { _ }], &[T; { _ }])
where [(); { _ }]:,

Divides an array-slice into chunks, then yielding the rest in a separate array-slice.

§Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array__ops::*;
 
let transistors = ["2N3904", "2N2222A", "BC107", "AC127", "OC7", "NKT275", "2SK30A", "2N5458", "J108", "2N7000", "BS170"];
 
let ([silicon_bjts, germanium_bjts, jfets], mosfets) = transistors.chunks_ref::<3>();
 
assert_eq!(silicon_bjts, &["2N3904", "2N2222A", "BC107"]);
assert_eq!(germanium_bjts, &["AC127", "OC7", "NKT275"]);
assert_eq!(jfets, &["2SK30A", "2N5458", "J108"]);
assert_eq!(mosfets, &["2N7000", "BS170"]);
source

fn chunks_mut<const M: usize>( &mut self ) -> (&mut [[T; M]; { _ }], &mut [T; { _ }])
where [(); { _ }]:,

Divides a mutable array-slice into chunks, then yielding the rest in a separate mutable array-slice.

§Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array__ops::*;
 
let mut array = [0, 1, 0, 1, 0, 1, 6];
 
let (pairs, last) = array.chunks_mut::<2>();
 
for (i, pair) in pairs.into_iter().enumerate()
{
    for number in pair
    {
        *number += i*2;
    }
}
 
assert_eq!(array, [0, 1, 2, 3, 4, 5, 6]);
source

fn rchunks<const M: usize>(self) -> ([T; { _ }], [[T; M]; { _ }])
where [(); { _ }]:,

Divides a mutable array-slice into chunks, then yielding the leftmost rest in a separate mutable array-slice.

source

fn rchunks_ref<const M: usize>(&self) -> (&[T; { _ }], &[[T; M]; { _ }])
where [(); { _ }]:,

Divides an array-slice into chunks, then yielding the leftmost rest in a separate array-slice.

source

fn rchunks_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [[T; M]; { _ }])
where [(); { _ }]:,

Divides a mutable array-slice into chunks, then yielding the leftmost rest in a separate array-slice.

source

fn chunks_exact<const M: usize>(self) -> [[T; M]; { _ }]
where [(); { _ }]:,

Divides an array into chunks, with no rest.

The chunk length must be a factor of the array length, otherwise it will not compile.

§Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array__ops::*;
 
let array = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9];
 
let [lower_half, upper_half] = array.chunks_exact::<5>();
 
assert_eq!(lower_half, [0.0, 0.1, 0.2, 0.3, 0.4]);
assert_eq!(upper_half, [0.5, 0.6, 0.7, 0.8, 0.9]);
source

fn chunks_exact_ref<const M: usize>(&self) -> &[[T; M]; { _ }]
where [(); { _ }]:,

Divides an array-slice into chunks, with no rest.

The chunk length must be a factor of the array length, otherwise it will not compile.

§Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array__ops::*;
 
let array = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9];
 
let [lower_half, upper_half] = array.chunks_exact_ref::<5>();
 
assert_eq!(lower_half, &[0.0, 0.1, 0.2, 0.3, 0.4]);
assert_eq!(upper_half, &[0.5, 0.6, 0.7, 0.8, 0.9]);
source

fn chunks_exact_mut<const M: usize>(&mut self) -> &mut [[T; M]; { _ }]
where [(); { _ }]:,

Divides a mutable array-slice into chunks, with no rest.

The chunk length must be a factor of the array length, otherwise it will not compile.

source

fn array_simd<const M: usize>(self) -> ([Simd<T, M>; { _ }], [T; { _ }])

source

fn array_rsimd<const M: usize>(self) -> ([T; { _ }], [Simd<T, M>; { _ }])

source

fn array_simd_exact<const M: usize>(self) -> [Simd<T, M>; { _ }]

source

fn split_array<const M: usize>(self) -> ([T; M], [T; { _ }])
where [(); { _ }]:,

Splits an array at a chosen index.

source

fn split_array_ref2<const M: usize>(&self) -> (&[T; M], &[T; { _ }])
where [(); { _ }]:,

Splits an array at a chosen index as array-slices.

source

fn split_array_mut2<const M: usize>(&mut self) -> (&mut [T; M], &mut [T; { _ }])
where [(); { _ }]:,

Splits an array at a chosen index as mutable array-slices.

source

fn rsplit_array<const M: usize>(self) -> ([T; { _ }], [T; M])
where [(); { _ }]:,

Splits an array at a chosen index, where the index goes from right to left.

source

fn rsplit_array_ref2<const M: usize>(&self) -> (&[T; { _ }], &[T; M])
where [(); { _ }]:,

Splits an array at a chosen index as array-slices, where the index goes from right to left.

source

fn rsplit_array_mut2<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [T; M])
where [(); { _ }]:,

Splits an array at a chosen index as mutable array-slices, where the index goes from right to left.

source

fn each_ref2(&self) -> [&T; N]

source

fn each_mut2(&mut self) -> [&mut T; N]

source

fn bit_reverse_permutation(&mut self)
where [(); { _ }]:,

Performs the bit-reverse permutation. Length must be a power of 2.

§Example
use array__ops::*;
 
let mut arr = [0b000, 0b001, 0b010, 0b011, 0b100, 0b101, 0b110, 0b111];
 
arr.bit_reverse_permutation();
 
assert_eq!(arr, [0b000, 0b100, 0b010, 0b110, 0b001, 0b101, 0b011, 0b111])

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T, const N: usize> ArrayOps<T, N> for [T; N]

source§

fn split_len(mid: usize) -> (usize, usize)

source§

fn rsplit_len(mid: usize) -> (usize, usize)

source§

fn split_ptr(&self, mid: usize) -> (*const T, *const T)

source§

fn split_mut_ptr(&mut self, mid: usize) -> (*mut T, *mut T)

source§

fn rsplit_ptr(&self, mid: usize) -> (*const T, *const T)

source§

fn rsplit_mut_ptr(&mut self, mid: usize) -> (*mut T, *mut T)

source§

fn fill<F>(fill: F) -> Self
where F: FnMut(usize) -> T + Destruct,

source§

fn rfill<F>(fill: F) -> Self
where F: FnMut(usize) -> T + Destruct,

source§

fn fill_boxed<F>(fill: F) -> Box<Self>
where F: FnMut(usize) -> T + Destruct,

source§

fn rfill_boxed<F>(fill: F) -> Box<Self>
where F: FnMut(usize) -> T + Destruct,

source§

fn fill_boxed_in<F, A>(fill: F, alloc: A) -> Box<Self, A>
where F: FnMut(usize) -> T + Destruct, A: Allocator,

source§

fn rfill_boxed_in<F, A>(fill: F, alloc: A) -> Box<Self, A>
where F: FnMut(usize) -> T + Destruct, A: Allocator,

source§

fn truncate<const M: usize>(self) -> [T; M]
where T: Destruct, [(); { _ }]:,

source§

fn rtruncate<const M: usize>(self) -> [T; M]
where T: Destruct, [(); { _ }]:,

source§

fn truncate_ref<const M: usize>(&self) -> &[T; M]
where [(); { _ }]:,

source§

fn rtruncate_ref<const M: usize>(&self) -> &[T; M]
where [(); { _ }]:,

source§

fn truncate_mut<const M: usize>(&mut self) -> &mut [T; M]
where [(); { _ }]:,

source§

fn rtruncate_mut<const M: usize>(&mut self) -> &mut [T; M]
where [(); { _ }]:,

source§

fn resize<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T + Destruct, T: Destruct,

source§

fn rresize<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T + Destruct, T: Destruct,

source§

fn into_rotate_left(self, n: usize) -> Self

source§

fn into_rotate_right(self, n: usize) -> Self

source§

fn into_shift_many_left<const M: usize>(self, items: [T; M]) -> ([T; M], Self)

source§

fn into_shift_many_right<const M: usize>(self, items: [T; M]) -> (Self, [T; M])

source§

fn into_shift_left(self, item: T) -> (T, Self)

source§

fn into_shift_right(self, item: T) -> (Self, T)

source§

fn rotate_left2(&mut self, n: usize)

source§

fn rotate_right2(&mut self, n: usize)

source§

fn shift_many_left<const M: usize>(&mut self, items: [T; M]) -> [T; M]

source§

fn shift_many_right<const M: usize>(&mut self, items: [T; M]) -> [T; M]

source§

fn shift_left(&mut self, item: T) -> T

source§

fn shift_right(&mut self, item: T) -> T

source§

fn extend<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T + Destruct, [(); { _ }]:,

source§

fn rextend<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T + Destruct, [(); { _ }]:,

source§

fn reformulate_length<const M: usize>(self) -> [T; M]
where [(); { _ }]:,

source§

fn reformulate_length_ref<const M: usize>(&self) -> &[T; M]
where [(); { _ }]:,

source§

fn reformulate_length_mut<const M: usize>(&mut self) -> &mut [T; M]
where [(); { _ }]:,

source§

fn try_reformulate_length<const M: usize>(self) -> Result<[T; M], Self>

source§

fn try_reformulate_length_ref<const M: usize>(&self) -> Option<&[T; M]>

source§

fn try_reformulate_length_mut<const M: usize>(&mut self) -> Option<&mut [T; M]>

source§

fn into_collumn(self) -> [[T; 1]; N]

source§

fn as_collumn(&self) -> &[[T; 1]; N]

source§

fn as_collumn_mut(&mut self) -> &mut [[T; 1]; N]

source§

fn map2<Map>(self, map: Map) -> [Map::Output; N]
where Map: FnMut<(T,)> + Destruct,

source§

fn map_outer<Map>(&self, map: Map) -> [[Map::Output; N]; N]
where Map: FnMut<(T, T)> + Destruct, T: Copy,

source§

fn comap<Map, Rhs>(self, rhs: [Rhs; N], map: Map) -> [Map::Output; N]
where Map: FnMut<(T, Rhs)> + Destruct,

source§

fn comap_outer<Map, Rhs, const M: usize>( &self, rhs: &[Rhs; M], map: Map ) -> [[Map::Output; M]; N]
where Map: FnMut<(T, Rhs)> + Destruct, T: Copy, Rhs: Copy,

source§

fn flat_map<Map, O, const M: usize>(self, map: Map) -> [O; { _ }]
where Map: FnMut<(T,), Output = [O; M]> + Destruct,

source§

fn map_assign<Map>(&mut self, map: Map)
where Map: FnMut(T) -> T + Destruct,

source§

fn zip<Z>(self, other: [Z; N]) -> [(T, Z); N]

source§

fn zip_outer<Z, const M: usize>(&self, other: &[Z; M]) -> [[(T, Z); M]; N]
where T: Copy, Z: Copy,

source§

fn enumerate(self) -> [(usize, T); N]

source§

fn diagonal<const H: usize, const W: usize>(self) -> [[T; W]; H]
where T: Default, [(); { _ }]:,

source§

fn differentiate(&mut self)
where T: SubAssign<T> + Copy + Destruct,

source§

fn integrate(&mut self)
where T: AddAssign<T> + Copy + Destruct,

source§

fn reduce<R>(self, reduce: R) -> Option<T>
where R: FnMut(T, T) -> T + Destruct,

source§

fn try_sum(self) -> Option<T>
where T: AddAssign,

source§

fn sum_from<S>(self, from: S) -> S
where S: AddAssign<T>,

source§

fn try_product(self) -> Option<T>
where T: MulAssign,

source§

fn product_from<P>(self, from: P) -> P
where P: MulAssign<T>,

source§

fn max(self) -> Option<T>
where T: Ord,

source§

fn min(self) -> Option<T>
where T: Ord,

source§

fn first_max(self) -> Option<T>
where T: PartialOrd<T>,

source§

fn first_min(self) -> Option<T>
where T: PartialOrd<T>,

source§

fn argmax(&self) -> Option<usize>
where T: PartialOrd<T>,

source§

fn argmin(&self) -> Option<usize>
where T: PartialOrd<T>,

source§

fn add_all<Rhs>(self, rhs: Rhs) -> [<T as Add<Rhs>>::Output; N]
where T: Add<Rhs>, Rhs: Copy,

source§

fn sub_all<Rhs>(self, rhs: Rhs) -> [<T as Sub<Rhs>>::Output; N]
where T: Sub<Rhs>, Rhs: Copy,

source§

fn mul_all<Rhs>(self, rhs: Rhs) -> [<T as Mul<Rhs>>::Output; N]
where T: Mul<Rhs>, Rhs: Copy,

source§

fn div_all<Rhs>(self, rhs: Rhs) -> [<T as Div<Rhs>>::Output; N]
where T: Div<Rhs>, Rhs: Copy,

source§

fn rem_all<Rhs>(self, rhs: Rhs) -> [<T as Rem<Rhs>>::Output; N]
where T: Rem<Rhs>, Rhs: Copy,

source§

fn shl_all<Rhs>(self, rhs: Rhs) -> [<T as Shl<Rhs>>::Output; N]
where T: Shl<Rhs>, Rhs: Copy,

source§

fn shr_all<Rhs>(self, rhs: Rhs) -> [<T as Shr<Rhs>>::Output; N]
where T: Shr<Rhs>, Rhs: Copy,

source§

fn bitor_all<Rhs>(self, rhs: Rhs) -> [<T as BitOr<Rhs>>::Output; N]
where T: BitOr<Rhs>, Rhs: Copy,

source§

fn bitand_all<Rhs>(self, rhs: Rhs) -> [<T as BitAnd<Rhs>>::Output; N]
where T: BitAnd<Rhs>, Rhs: Copy,

source§

fn bitxor_all<Rhs>(self, rhs: Rhs) -> [<T as BitXor<Rhs>>::Output; N]
where T: BitXor<Rhs>, Rhs: Copy,

source§

fn add_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: AddAssign<Rhs>, Rhs: Copy,

source§

fn sub_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: SubAssign<Rhs>, Rhs: Copy,

source§

fn mul_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: MulAssign<Rhs>, Rhs: Copy,

source§

fn div_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: DivAssign<Rhs>, Rhs: Copy,

source§

fn rem_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: RemAssign<Rhs>, Rhs: Copy,

source§

fn shl_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: ShlAssign<Rhs>, Rhs: Copy,

source§

fn shr_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: ShrAssign<Rhs>, Rhs: Copy,

source§

fn bitor_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: BitOrAssign<Rhs>, Rhs: Copy,

source§

fn bitand_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: BitAndAssign<Rhs>, Rhs: Copy,

source§

fn bitxor_assign_all<Rhs>(&mut self, rhs: Rhs)
where T: BitXorAssign<Rhs>, Rhs: Copy,

source§

fn add_all_neg<Rhs>(self, rhs: Rhs) -> [<Rhs as Sub<T>>::Output; N]
where Rhs: Copy + Sub<T>,

source§

fn mul_all_inv<Rhs>(self, rhs: Rhs) -> [<Rhs as Div<T>>::Output; N]
where Rhs: Copy + Div<T>,

source§

fn neg_all(self) -> [<T as Neg>::Output; N]
where T: Neg,

source§

fn neg_assign_all(&mut self)
where T: Neg<Output = T>,

source§

fn add_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Add<Rhs>>::Output; N]
where T: Add<Rhs>,

source§

fn sub_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Sub<Rhs>>::Output; N]
where T: Sub<Rhs>,

source§

fn mul_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Mul<Rhs>>::Output; N]
where T: Mul<Rhs>,

source§

fn div_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Div<Rhs>>::Output; N]
where T: Div<Rhs>,

source§

fn rem_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Rem<Rhs>>::Output; N]
where T: Rem<Rhs>,

source§

fn shl_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Shl<Rhs>>::Output; N]
where T: Shl<Rhs>,

source§

fn shr_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Shr<Rhs>>::Output; N]
where T: Shr<Rhs>,

source§

fn bitor_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as BitOr<Rhs>>::Output; N]
where T: BitOr<Rhs>,

source§

fn bitand_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as BitAnd<Rhs>>::Output; N]
where T: BitAnd<Rhs>,

source§

fn bitxor_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as BitXor<Rhs>>::Output; N]
where T: BitXor<Rhs>,

source§

fn add_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: AddAssign<Rhs>,

source§

fn sub_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: SubAssign<Rhs>,

source§

fn mul_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: MulAssign<Rhs>,

source§

fn div_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: DivAssign<Rhs>,

source§

fn rem_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: RemAssign<Rhs>,

source§

fn shl_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: ShlAssign<Rhs>,

source§

fn shr_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: ShrAssign<Rhs>,

source§

fn bitor_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: BitOrAssign<Rhs>,

source§

fn bitand_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: BitAndAssign<Rhs>,

source§

fn bitxor_assign_each<Rhs>(&mut self, rhs: [Rhs; N])
where T: BitXorAssign<Rhs>,

source§

fn try_mul_dot<Rhs>(self, rhs: [Rhs; N]) -> Option<<T as Mul<Rhs>>::Output>
where T: Mul<Rhs, Output: AddAssign>,

source§

fn mul_dot_bias<Rhs>( self, rhs: [Rhs; N], bias: <T as Mul<Rhs>>::Output ) -> <T as Mul<Rhs>>::Output
where T: Mul<Rhs, Output: AddAssign>,

source§

fn mul_outer<Rhs, const M: usize>( &self, rhs: &[Rhs; M] ) -> [[<T as Mul<Rhs>>::Output; M]; N]
where T: Mul<Rhs> + Copy, Rhs: Copy,

source§

fn mul_cross<Rhs>(&self, rhs: [&[Rhs; N]; { _ }]) -> [<T as Sub>::Output; N]
where T: MulAssign<Rhs> + Sub + Copy, Rhs: Copy,

source§

fn try_magnitude_squared(self) -> Option<<T as Mul<T>>::Output>
where T: Mul<T, Output: AddAssign> + Copy,

source§

fn chain<const M: usize>(self, rhs: [T; M]) -> [T; { _ }]

source§

fn rchain<const M: usize>(self, rhs: [T; M]) -> [T; { _ }]

source§

fn spread<const M: usize>(self) -> ([[T; { _ }]; M], [T; { _ }])
where [(); { _ }]:,

source§

fn spread_ref<const M: usize>( &self ) -> ([&[Padded<T, M>; { _ }]; M], &[T; { _ }])
where [(); { _ }]:,

source§

fn spread_mut<const M: usize>( &mut self ) -> ([&mut [Padded<T, M>; { _ }]; M], &mut [T; { _ }])
where [(); { _ }]:,

source§

fn rspread<const M: usize>(self) -> ([T; { _ }], [[T; { _ }]; M])
where [(); { _ }]:,

source§

fn rspread_ref<const M: usize>( &self ) -> (&[T; { _ }], [&[Padded<T, M>; { _ }]; M])
where [(); { _ }]:,

source§

fn rspread_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], [&mut [Padded<T, M>; { _ }]; M])
where [(); { _ }]:,

source§

fn spread_exact<const M: usize>(self) -> [[T; { _ }]; M]
where [(); { _ }]:,

source§

fn spread_exact_ref<const M: usize>(&self) -> [&[Padded<T, M>; { _ }]; M]
where [(); { _ }]:,

source§

fn spread_exact_mut<const M: usize>( &mut self ) -> [&mut [Padded<T, M>; { _ }]; M]
where [(); { _ }]:,

source§

fn chunks<const M: usize>(self) -> ([[T; M]; { _ }], [T; { _ }])

source§

fn chunks_ref<const M: usize>(&self) -> (&[[T; M]; { _ }], &[T; { _ }])

source§

fn chunks_mut<const M: usize>( &mut self ) -> (&mut [[T; M]; { _ }], &mut [T; { _ }])

source§

fn rchunks<const M: usize>(self) -> ([T; { _ }], [[T; M]; { _ }])

source§

fn rchunks_ref<const M: usize>(&self) -> (&[T; { _ }], &[[T; M]; { _ }])

source§

fn rchunks_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [[T; M]; { _ }])

source§

fn chunks_exact<const M: usize>(self) -> [[T; M]; { _ }]
where [(); { _ }]:,

source§

fn chunks_exact_ref<const M: usize>(&self) -> &[[T; M]; { _ }]
where [(); { _ }]:,

source§

fn chunks_exact_mut<const M: usize>(&mut self) -> &mut [[T; M]; { _ }]
where [(); { _ }]:,

source§

fn array_simd<const M: usize>(self) -> ([Simd<T, M>; { _ }], [T; { _ }])

source§

fn array_rsimd<const M: usize>(self) -> ([T; { _ }], [Simd<T, M>; { _ }])

source§

fn array_simd_exact<const M: usize>(self) -> [Simd<T, M>; { _ }]

source§

fn split_array<const M: usize>(self) -> ([T; M], [T; { _ }])
where [(); { _ }]:,

source§

fn split_array_ref2<const M: usize>(&self) -> (&[T; M], &[T; { _ }])
where [(); { _ }]:,

source§

fn split_array_mut2<const M: usize>(&mut self) -> (&mut [T; M], &mut [T; { _ }])
where [(); { _ }]:,

source§

fn rsplit_array<const M: usize>(self) -> ([T; { _ }], [T; M])
where [(); { _ }]:,

source§

fn rsplit_array_mut2<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [T; M])
where [(); { _ }]:,

source§

fn rsplit_array_ref2<const M: usize>(&self) -> (&[T; { _ }], &[T; M])
where [(); { _ }]:,

source§

fn each_ref2(&self) -> [&T; N]

source§

fn each_mut2(&mut self) -> [&mut T; N]

source§

fn bit_reverse_permutation(&mut self)
where [(); { _ }]:,

Implementors§