pub type PermRef<'a, I, N = usize> = Perm<Ref<'a, I, N>>;Expand description
immutable permutation matrix view
Aliased Type§
#[repr(transparent)]pub struct PermRef<'a, I, N = usize>(pub Ref<'a, I, N>);Tuple Fields§
§0: Ref<'a, I, N>Implementations§
Source§impl<'a, I: Index, N: Shape> PermRef<'a, I, N>
impl<'a, I: Index, N: Shape> PermRef<'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