Struct PermRef
pub struct PermRef<'a, I>where
I: Index,{
pub(super) forward: &'a [I],
pub(super) inverse: &'a [I],
}
Expand description
Immutable permutation matrix view.
Fields§
§forward: &'a [I]
§inverse: &'a [I]
Implementations§
§impl<'a, I> PermRef<'a, I>where
I: Index,
impl<'a, I> PermRef<'a, I>where
I: Index,
pub fn new_checked(forward: &'a [I], inverse: &'a [I]) -> PermRef<'a, I>
pub fn new_checked(forward: &'a [I], inverse: &'a [I]) -> PermRef<'a, I>
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.
pub unsafe fn new_unchecked(
forward: &'a [I],
inverse: &'a [I],
) -> PermRef<'a, I>
pub unsafe fn new_unchecked( forward: &'a [I], inverse: &'a [I], ) -> PermRef<'a, I>
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.
pub fn canonicalized(self) -> PermRef<'a, <I as Index>::FixedWidth>
pub fn canonicalized(self) -> PermRef<'a, <I as Index>::FixedWidth>
Cast the permutation to the fixed width index type.
pub fn uncanonicalized<J>(self) -> PermRef<'a, J>where
J: Index,
pub fn uncanonicalized<J>(self) -> PermRef<'a, J>where
J: Index,
Cast the permutation from the fixed width index type.
Trait Implementations§
§impl<'short, I> ReborrowMut<'short> for PermRef<'_, I>where
I: Index,
impl<'short, I> ReborrowMut<'short> for PermRef<'_, I>where
I: Index,
impl<I> Copy for PermRef<'_, I>where
I: Index,
Auto Trait Implementations§
impl<'a, I> Freeze for PermRef<'a, I>
impl<'a, I> RefUnwindSafe for PermRef<'a, I>where
I: RefUnwindSafe,
impl<'a, I> Send for PermRef<'a, I>
impl<'a, I> Sync for PermRef<'a, I>
impl<'a, I> Unpin for PermRef<'a, I>
impl<'a, I> UnwindSafe for PermRef<'a, I>where
I: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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> ⓘ
Converts
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> ⓘ
Converts
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 more