PermD

Type Alias PermD 

Source
pub type PermD = Perm<Dynamic>;
Expand description

Permutation type with runtime size.

Aliased Type§

pub struct PermD { /* private fields */ }

Implementations§

Source§

impl PermD

Source

pub fn empty() -> Self

Source

pub fn unit() -> Self

Source

pub fn swap(size: usize, first: usize, second: usize) -> Option<Self>

Source

pub fn identity(size: usize) -> Self

Source

pub fn cycle(size: usize) -> Self

Source

pub fn reverse_cycle(size: usize) -> Self

Source

pub fn permute_indices(&self, perm: &PermD) -> Option<Self>

Source

pub fn conjugate_with(&self, other: &PermD) -> Option<Self>

Source

pub fn to_size(&self, new_size: usize) -> Option<PermD>

Source

pub fn into_static<const SIZE: usize>(self) -> Option<PermS<SIZE>>

Trait Implementations§

Source§

impl Mul<&Perm<Dynamic>> for &PermD

Source§

type Output = Perm<Dynamic>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &PermD) -> Self::Output

Performs the * operation. Read more
Source§

impl<const SIZE: usize> Mul<&Perm<Static<SIZE>>> for &PermD

Source§

type Output = Perm<Static<SIZE>>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &PermS<SIZE>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T> PermApply<[T]> for PermD

Source§

type Output = Result<(), &'static str>

Source§

fn apply(&self, input: &mut [T]) -> Self::Output

Source§

impl<T, const SIZE: usize> PermApply<[T; SIZE]> for PermD

Source§

type Output = Result<(), &'static str>

Source§

fn apply(&self, input: &mut [T; SIZE]) -> Self::Output

Source§

impl<T> PermApply<Vec<T>> for PermD

Source§

type Output = Result<(), &'static str>

Source§

fn apply(&self, input: &mut Vec<T>) -> Self::Output

Source§

impl PermFromIndices<&[usize]> for PermD

Source§

fn from_indices(indices: &[usize]) -> Option<Self>

Builds a dynamic permutation from a slice of indices.

Source§

impl<const SIZE: usize> PermFromIndices<[usize; SIZE]> for PermD

Source§

fn from_indices(indices: [usize; SIZE]) -> Option<Self>

Builds a dynamic permutation from an array of indices.

Source§

impl PermFromIndices<Cow<'_, [usize]>> for PermD

Source§

fn from_indices(indices: Cow<'_, [usize]>) -> Option<Self>

Builds a dynamic permutation from a copy-on-write slice of indices.

Source§

impl PermFromIndices<Vec<usize>> for PermD

Source§

fn from_indices(indices: Vec<usize>) -> Option<Self>

Builds a dynamic permutation from a vector of indices.

Source§

impl<T> PermFromSorting<&[T], T> for PermD

Source§

type Output = Perm<Dynamic>

Source§

fn from_sort(vec: &[T]) -> Self::Output
where T: Ord,

Builds a permutation by sorting a slice-like type.
Source§

fn from_sort_by<F>(vec: &[T], compare: F) -> Self::Output
where F: FnMut(&T, &T) -> Ordering,

Builds a permutation by sorting a slice-like type with a comparing function.
Source§

fn from_sort_by_key<B, F>(vec: &[T], f: F) -> Self::Output
where B: Ord, F: FnMut(&T) -> B,

Builds a permutation by sorting a slice-like type with a key function.
Source§

fn from_sort_by_cached_key<B, F>(vec: &[T], f: F) -> Self::Output
where B: Ord, F: FnMut(&T) -> B,

Builds a permutation by sorting a slice-like type with a key function. The key is not re-computed twice.
Source§

impl<T, const SIZE: usize> PermFromSorting<&[T; SIZE], T> for PermD

Source§

type Output = Perm<Dynamic>

Source§

fn from_sort(vec: &[T; SIZE]) -> Self::Output
where T: Ord,

Builds a permutation by sorting a slice-like type.
Source§

fn from_sort_by<F>(vec: &[T; SIZE], compare: F) -> Self::Output
where F: FnMut(&T, &T) -> Ordering,

Builds a permutation by sorting a slice-like type with a comparing function.
Source§

fn from_sort_by_key<B, F>(vec: &[T; SIZE], f: F) -> Self::Output
where B: Ord, F: FnMut(&T) -> B,

Builds a permutation by sorting a slice-like type with a key function.
Source§

fn from_sort_by_cached_key<B, F>(vec: &[T; SIZE], f: F) -> Self::Output
where B: Ord, F: FnMut(&T) -> B,

Builds a permutation by sorting a slice-like type with a key function. The key is not re-computed twice.
Source§

impl<T, const SIZE: usize> PermFromSorting<[T; SIZE], T> for PermD

Source§

type Output = Perm<Dynamic>

Source§

fn from_sort(vec: [T; SIZE]) -> Self::Output
where T: Ord,

Builds a permutation by sorting a slice-like type.
Source§

fn from_sort_by<F>(vec: [T; SIZE], compare: F) -> Self::Output
where F: FnMut(&T, &T) -> Ordering,

Builds a permutation by sorting a slice-like type with a comparing function.
Source§

fn from_sort_by_key<B, F>(vec: [T; SIZE], f: F) -> Self::Output
where B: Ord, F: FnMut(&T) -> B,

Builds a permutation by sorting a slice-like type with a key function.
Source§

fn from_sort_by_cached_key<B, F>(vec: [T; SIZE], f: F) -> Self::Output
where B: Ord, F: FnMut(&T) -> B,

Builds a permutation by sorting a slice-like type with a key function. The key is not re-computed twice.
Source§

impl<T> PermFromSorting<Vec<T>, T> for PermD

Source§

type Output = Perm<Dynamic>

Source§

fn from_sort(vec: Vec<T>) -> Self::Output
where T: Ord,

Builds a permutation by sorting a slice-like type.
Source§

fn from_sort_by<F>(vec: Vec<T>, compare: F) -> Self::Output
where F: FnMut(&T, &T) -> Ordering,

Builds a permutation by sorting a slice-like type with a comparing function.
Source§

fn from_sort_by_key<B, F>(vec: Vec<T>, f: F) -> Self::Output
where B: Ord, F: FnMut(&T) -> B,

Builds a permutation by sorting a slice-like type with a key function.
Source§

fn from_sort_by_cached_key<B, F>(vec: Vec<T>, f: F) -> Self::Output
where B: Ord, F: FnMut(&T) -> B,

Builds a permutation by sorting a slice-like type with a key function. The key is not re-computed twice.
Source§

impl PermProduct<Perm<Dynamic>> for PermD

Source§

type Output = Option<Perm<Dynamic>>

Source§

fn perm_product(&self, other: &PermD) -> Self::Output

Source§

impl<const SIZE: usize> PermProduct<Perm<Static<SIZE>>> for PermD

Source§

type Output = Option<Perm<Static<SIZE>>>

Source§

fn perm_product(&self, other: &PermS<SIZE>) -> Self::Output

Source§

impl Permutation for PermD

Source§

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

Gets the reference to the internal permuted indices.
Source§

fn len(&self) -> usize

Gets the size of permutation.
Source§

fn inverse(&self) -> Self

Builds the inverse of permutation.
Source§

fn pow(&self, exp: u32) -> Self

Source§

impl<'a, const SIZE: usize> Product<&'a Perm<Static<SIZE>>> for PermD

Source§

fn product<I>(iter: I) -> Self
where I: Iterator<Item = &'a PermS<SIZE>>,

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<const SIZE: usize> Product<Perm<Static<SIZE>>> for PermD

Source§

fn product<I>(iter: I) -> Self
where I: Iterator<Item = PermS<SIZE>>,

Takes an iterator and generates Self from the elements by multiplying the items.