pub struct OwnedPermutation<T: Sync + AsRef<[usize]>>(/* private fields */);
Expand description

A Permutation backed by an usize vector

Implementations§

source§

impl<T: Sync + AsRef<[usize]>> OwnedPermutation<T>

source

pub unsafe fn new_unchecked(perm: T) -> Self

Creates a permutation

Safety

This function is not unsafe per-se, but it does not check node ids in the permutation’s image are correct or unique, which will violate assumptions of other unsafe functions down the line.

source

pub fn new(perm: T) -> Result<Self>

Creates a permutation, or returns an error in case the permutation is incorrect

source

pub fn dump<W: Write>(&self, file: &mut W) -> Result<()>

source§

impl<T: Sync + AsRef<[usize]> + AsMut<[usize]>> OwnedPermutation<T>

source

pub fn compose_in_place<T2: Permutation + Sync>( &mut self, other: T2 ) -> Result<()>

Applies the other permutation to self, so self becomes a new permutation.

source§

impl OwnedPermutation<Vec<usize>>

source

pub unsafe fn load_unchecked(num_nodes: usize, path: &Path) -> Result<Self>

Loads a permutation from disk and returns IO errors if any.

Safety

This function is not unsafe per-se, but it does not check node ids in the permutation’s image are correct or unique, which will violate assumptions of other unsafe functions down the line.

source

pub fn load(num_nodes: usize, path: &Path) -> Result<Self>

Loads a permutation from disk, and returns errors in case of IO errors or incorrect permutations.

Trait Implementations§

source§

impl<T: Sync + AsRef<[usize]> + AsMut<[usize]>> AsMut<[usize]> for OwnedPermutation<T>

source§

fn as_mut(&mut self) -> &mut [usize]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T: Sync + AsRef<[usize]>> AsRef<[usize]> for OwnedPermutation<T>

source§

fn as_ref(&self) -> &[usize]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T: Sync + AsRef<[usize]>> Index<usize> for OwnedPermutation<T>

§

type Output = usize

The returned type after indexing.
source§

fn index(&self, old_node: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<T: Sync + AsRef<[usize]>> Permutation for OwnedPermutation<T>

source§

fn len(&self) -> usize

Returns the number of items
source§

fn get(&self, old_node: usize) -> Option<usize>

Returns an item
source§

unsafe fn get_unchecked(&self, old_node: usize) -> usize

Returns an item without checking it is within the bounds Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for OwnedPermutation<T>where T: RefUnwindSafe,

§

impl<T> Send for OwnedPermutation<T>where T: Send,

§

impl<T> Sync for OwnedPermutation<T>

§

impl<T> Unpin for OwnedPermutation<T>where T: Unpin,

§

impl<T> UnwindSafe for OwnedPermutation<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> BitFieldSlice<usize> for Twhere T: AsRef<[usize]>,

§

unsafe fn get_unchecked(&self, index: usize) -> usize

Return the value at the specified index. Read more
§

fn get(&self, index: usize) -> W

Return the value at the specified index. Read more
§

impl<T> BitFieldSliceCore<usize> for Twhere T: AsRef<[usize]>,

§

fn bit_width(&self) -> usize

Return the width of the slice. All elements stored in the slice must fit within this bit width.
§

fn len(&self) -> usize

Return the length of the slice.
§

fn is_empty(&self) -> bool

Return if the slice has length zero
§

impl<T> BitFieldSliceMut<usize> for Twhere T: AsMut<[usize]> + AsRef<[usize]>,

§

unsafe fn set_unchecked(&mut self, index: usize, value: usize)

Set the element of the slice at the specified index. No bounds checking is performed. Read more
§

fn reset(&mut self)

Set all values to zero
§

fn set(&mut self, index: usize, value: W)

Set the element of the slice at the specified index. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CastableFrom<T> for T

§

fn cast_from(value: T) -> T

Call Self as W
§

impl<T, U> CastableInto<U> for Twhere U: CastableFrom<T>,

§

fn cast(self) -> U

Call W::cast_from(self)
§

impl<T> DowncastableFrom<T> for T

§

fn downcast_from(value: T) -> T

Truncate the current UnsignedInt to a possibly smaller size
§

impl<T, U> DowncastableInto<U> for Twhere U: DowncastableFrom<T>,

§

fn downcast(self) -> U

Call W::downcast_from(self)
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, W> HasTypeWitness<W> for Twhere W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

impl<T> Identity for Twhere T: ?Sized,

§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Splat<T> for T

§

fn splat(value: T) -> T

§

impl<T> To<T> for T

§

fn to(self) -> T

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> UpcastableFrom<T> for T

§

fn upcast_from(value: T) -> T

Extend the current UnsignedInt to a possibly bigger size.
§

impl<T, U> UpcastableInto<U> for Twhere U: UpcastableFrom<T>,

§

fn upcast(self) -> U

Call W::upcast_from(self)
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> Allocation for Twhere T: RefUnwindSafe + Send + Sync,