PermS

Type Alias PermS 

Source
pub type PermS<const SIZE: usize> = Perm<Static<SIZE>>;
Expand description

Permutation type with static size known in compile time.

Aliased Type§

pub struct PermS<const SIZE: usize> { /* private fields */ }

Implementations§

Source§

impl<const SIZE: usize> PermS<SIZE>

Source

pub fn identity() -> Self

Source

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

Source

pub fn cycle() -> Self

Source

pub fn reverse_cycle() -> Self

Source

pub fn permute_indices(&self, perm: &PermS<SIZE>) -> Self

Source

pub fn conjugate_with(&self, other: &PermS<SIZE>) -> Self

Source

pub fn to_size<const NEW_SIZE: usize>(&self) -> Option<PermS<NEW_SIZE>>

Source§

impl<const SIZE: usize> PermS<SIZE>

Source

pub fn into_dynamic(self) -> PermD

Trait Implementations§

Source§

impl<const SIZE: usize> Mul<&Perm<Dynamic>> for &PermS<SIZE>

Source§

type Output = Perm<Static<SIZE>>

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 &PermS<SIZE>

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, const SIZE: usize> PermApply<[T]> for PermS<SIZE>

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 PermS<SIZE>

Source§

type Output = ()

Source§

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

Source§

impl<T, const SIZE: usize> PermApply<Vec<T>> for PermS<SIZE>

Source§

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

Source§

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

Source§

impl<const SIZE: usize> PermFromIndices<&[usize]> for PermS<SIZE>

Source§

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

Builds a static permutation from a slice of indices.

Source§

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

Source§

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

Builds a static permutation from a borrowed array of indices.

Source§

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

Source§

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

Builds a static permutation from an owned array of indices.

Source§

impl<const SIZE: usize> PermFromIndices<Cow<'_, [usize]>> for PermS<SIZE>

Source§

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

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

Source§

impl<const SIZE: usize> PermFromIndices<Vec<usize>> for PermS<SIZE>

Source§

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

Builds a static permutation from a vector indices.

Source§

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

Source§

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

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 PermS<SIZE>

Source§

type Output = Perm<Static<SIZE>>

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 PermS<SIZE>

Source§

type Output = Perm<Static<SIZE>>

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<Vec<T>, T> for PermS<SIZE>

Source§

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

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<const SIZE: usize> PermProduct<Perm<Dynamic>> for PermS<SIZE>

Source§

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

Source§

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

Source§

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

Source§

type Output = Perm<Static<SIZE>>

Source§

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

Source§

impl<const SIZE: usize> Permutation for PermS<SIZE>

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 PermS<SIZE>

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 for PermS<SIZE>

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.