#[repr(transparent)]pub struct Perm<Inner>(pub Inner);Expand description
generic Perm wrapper
Tuple Fields§
§0: InnerImplementations§
Source§impl<I: Index, N: Shape> Perm<Own<I, N>>
impl<I: Index, N: Shape> Perm<Own<I, N>>
Sourcepub fn as_shape<M: Shape>(&self, dim: M) -> PermRef<'_, I, M>
pub fn as_shape<M: Shape>(&self, dim: M) -> PermRef<'_, I, M>
returns the input permutation with the given shape after checking that it matches the current shape
Sourcepub fn into_shape<M: Shape>(self, dim: M) -> Perm<I, M>
pub fn into_shape<M: Shape>(self, dim: M) -> Perm<I, M>
returns the input permutation with the given shape after checking that it matches the current shape
Sourcepub fn new_checked(
forward: Box<[Idx<N, I>]>,
inverse: Box<[Idx<N, I>]>,
dim: N,
) -> Self
pub fn new_checked( forward: Box<[Idx<N, I>]>, inverse: Box<[Idx<N, I>]>, dim: N, ) -> Self
creates a new permutation, by checking the validity of the inputs
§panics
the function panics if any of the following conditions are violated:
forward and inverse must have the same length which must be less
than or equal to I::Signed::MAX, be valid permutations, and be
inverse permutations of each other
Sourcepub unsafe fn new_unchecked(
forward: Box<[Idx<N, I>]>,
inverse: Box<[Idx<N, I>]>,
) -> Self
pub unsafe fn new_unchecked( forward: Box<[Idx<N, I>]>, inverse: Box<[Idx<N, I>]>, ) -> Self
creates a new permutation reference, without checking the validity of the inputs
§safety
forward and inverse must have the same length which must be less
than or equal to I::Signed::MAX, be valid permutations, and be
inverse permutations of each other
Sourcepub fn into_arrays(self) -> (Box<[Idx<N, I>]>, Box<[Idx<N, I>]>)
pub fn into_arrays(self) -> (Box<[Idx<N, I>]>, Box<[Idx<N, I>]>)
returns the permutation as an array
Sourcepub fn into_inverse(self) -> Self
pub fn into_inverse(self) -> Self
returns the inverse permutation
Source§impl<I: Index, N: Shape, Inner: for<'short> Reborrow<'short, Target = Ref<'short, I, N>>> Perm<Inner>
impl<I: Index, N: Shape, Inner: for<'short> Reborrow<'short, Target = Ref<'short, I, N>>> Perm<Inner>
Source§impl<'a, I: Index, N: Shape> Perm<Ref<'a, I, N>>
impl<'a, I: Index, N: Shape> Perm<Ref<'a, I, N>>
Sourcepub fn as_shape<M: Shape>(self, dim: M) -> PermRef<'a, I, M>
pub fn as_shape<M: Shape>(self, dim: M) -> PermRef<'a, I, M>
returns the input permutation with the given shape after checking that it matches the current shape
Sourcepub fn new_checked(
forward: &'a [Idx<N, I>],
inverse: &'a [Idx<N, I>],
dim: N,
) -> Self
pub fn new_checked( forward: &'a [Idx<N, I>], inverse: &'a [Idx<N, I>], dim: N, ) -> Self
creates a new permutation, by checking the validity of the inputs
§panics
the function panics if any of the following conditions are violated:
forwardandinversemust have the same length which must be less than or equal toI::Signed::MAX, be valid permutations, and be inverse permutations of each other
Sourcepub unsafe fn new_unchecked(
forward: &'a [Idx<N, I>],
inverse: &'a [Idx<N, I>],
dim: N,
) -> Self
pub unsafe fn new_unchecked( forward: &'a [Idx<N, I>], inverse: &'a [Idx<N, I>], dim: N, ) -> Self
creates a new permutation reference, without checking the validity of the inputs
§safety
forward and inverse must have the same length which must be less
than or equal to I::Signed::MAX, be valid permutations, and be
inverse permutations of each other
Sourcepub fn canonicalized(self) -> PermRef<'a, I::FixedWidth, N>
pub fn canonicalized(self) -> PermRef<'a, I::FixedWidth, N>
cast the permutation to the fixed width index type
Sourcepub fn uncanonicalized<J: Index>(self) -> PermRef<'a, J, N>
pub fn uncanonicalized<J: Index>(self) -> PermRef<'a, J, N>
cast the permutation from the fixed width index type
Source§impl<Inner> Perm<Inner>
impl<Inner> Perm<Inner>
Sourcepub fn from_inner_ref(inner: &Inner) -> &Self
pub fn from_inner_ref(inner: &Inner) -> &Self
wrap by reference
Sourcepub fn from_inner_mut(inner: &mut Inner) -> &mut Self
pub fn from_inner_mut(inner: &mut Inner) -> &mut Self
wrap by mutable reference
Trait Implementations§
impl<Inner: Copy> Copy for Perm<Inner>
Source§impl<I: Index, N: Shape, L: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>> Mul<&Perm<R>> for &Perm<L>
impl<I: Index, N: Shape, L: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>> Mul<&Perm<R>> for &Perm<L>
Source§impl<I: Index, N: Shape, L: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>> Mul<&Perm<R>> for Perm<L>
impl<I: Index, N: Shape, L: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>> Mul<&Perm<R>> for Perm<L>
Source§impl<I: Index, N: Shape, L: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>> Mul<Perm<R>> for Perm<L>
impl<I: Index, N: Shape, L: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>> Mul<Perm<R>> for Perm<L>
Source§impl<I: Index, N: Shape, L: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>> Mul<Perm<R>> for &Perm<L>
impl<I: Index, N: Shape, L: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>, R: for<'a> Reborrow<'a, Target = Ref<'a, I, N>>> Mul<Perm<R>> for &Perm<L>
Source§impl<LI: Index, LN: Shape, RI: Index, RN: Shape, L: for<'a> Reborrow<'a, Target = Ref<'a, LI, LN>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RI, RN>>> PartialEq<Perm<R>> for Perm<L>
impl<LI: Index, LN: Shape, RI: Index, RN: Shape, L: for<'a> Reborrow<'a, Target = Ref<'a, LI, LN>>, R: for<'a> Reborrow<'a, Target = Ref<'a, RI, RN>>> PartialEq<Perm<R>> for Perm<L>
Source§impl<'short, Inner: ReborrowMut<'short>> ReborrowMut<'short> for Perm<Inner>
impl<'short, Inner: ReborrowMut<'short>> ReborrowMut<'short> for Perm<Inner>
Auto Trait Implementations§
impl<Inner> Freeze for Perm<Inner>where
Inner: Freeze,
impl<Inner> RefUnwindSafe for Perm<Inner>where
Inner: RefUnwindSafe,
impl<Inner> Send for Perm<Inner>where
Inner: Send,
impl<Inner> Sync for Perm<Inner>where
Inner: Sync,
impl<Inner> Unpin for Perm<Inner>where
Inner: Unpin,
impl<Inner> UnsafeUnpin for Perm<Inner>where
Inner: UnsafeUnpin,
impl<Inner> UnwindSafe for Perm<Inner>where
Inner: UnwindSafe,
Blanket Implementations§
impl<T> Boilerplate for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CryptoRng for T
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R> Rng for R
impl<R> Rng for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
Source§fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Renamed to random to avoid conflict with the new gen keyword in Rust 2024.
Rng::random.Source§fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Renamed to random_range
Rng::random_range.impl<R> TryCryptoRng for R
Source§impl<R> TryRngCore for R
impl<R> TryRngCore for R
Source§fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
u32.Source§fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
u64.Source§fn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
dest entirely with random data.Source§fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
UnwrapMut wrapper.Source§fn read_adapter(&mut self) -> RngReadAdapter<'_, Self> ⓘwhere
Self: Sized,
fn read_adapter(&mut self) -> RngReadAdapter<'_, Self> ⓘwhere
Self: Sized,
RngCore to a RngReadAdapter.