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>
impl<const SIZE: usize> PermS<SIZE>
pub fn identity() -> Self
pub fn swap(first: usize, second: usize) -> Option<Self>
pub fn cycle() -> Self
pub fn reverse_cycle() -> Self
pub fn permute_indices(&self, perm: &PermS<SIZE>) -> Self
pub fn conjugate_with(&self, other: &PermS<SIZE>) -> Self
pub fn to_size<const NEW_SIZE: usize>(&self) -> Option<PermS<NEW_SIZE>>
Trait Implementations§
Source§impl<const SIZE: usize> PermFromIndices<&[usize]> for PermS<SIZE>
impl<const SIZE: usize> PermFromIndices<&[usize]> for PermS<SIZE>
Source§fn from_indices(indices: &[usize]) -> Option<Self>
fn from_indices(indices: &[usize]) -> Option<Self>
Builds a static permutation from a slice of indices.
Source§impl<T, const SIZE: usize> PermFromSorting<&[T], T> for PermS<SIZE>
impl<T, const SIZE: usize> PermFromSorting<&[T], T> for PermS<SIZE>
type Output = Option<Perm<Static<SIZE>>>
Source§fn from_sort(vec: &[T]) -> Self::Outputwhere
T: Ord,
fn from_sort(vec: &[T]) -> Self::Outputwhere
T: Ord,
Builds a permutation by sorting a slice-like type.
Source§fn from_sort_by<F>(vec: &[T], compare: F) -> Self::Output
fn from_sort_by<F>(vec: &[T], compare: F) -> Self::Output
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
fn from_sort_by_key<B, F>(vec: &[T], f: F) -> Self::Output
Builds a permutation by sorting a slice-like type with a key function.
Source§impl<T, const SIZE: usize> PermFromSorting<&[T; SIZE], T> for PermS<SIZE>
impl<T, const SIZE: usize> PermFromSorting<&[T; SIZE], T> for PermS<SIZE>
type Output = Perm<Static<SIZE>>
Source§fn from_sort(vec: &[T; SIZE]) -> Self::Outputwhere
T: Ord,
fn from_sort(vec: &[T; SIZE]) -> Self::Outputwhere
T: Ord,
Builds a permutation by sorting a slice-like type.
Source§fn from_sort_by<F>(vec: &[T; SIZE], compare: F) -> Self::Output
fn from_sort_by<F>(vec: &[T; SIZE], compare: F) -> Self::Output
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
fn from_sort_by_key<B, F>(vec: &[T; SIZE], f: F) -> Self::Output
Builds a permutation by sorting a slice-like type with a key function.
Source§impl<T, const SIZE: usize> PermFromSorting<[T; SIZE], T> for PermS<SIZE>
impl<T, const SIZE: usize> PermFromSorting<[T; SIZE], T> for PermS<SIZE>
type Output = Perm<Static<SIZE>>
Source§fn from_sort(vec: [T; SIZE]) -> Self::Outputwhere
T: Ord,
fn from_sort(vec: [T; SIZE]) -> Self::Outputwhere
T: Ord,
Builds a permutation by sorting a slice-like type.
Source§fn from_sort_by<F>(vec: [T; SIZE], compare: F) -> Self::Output
fn from_sort_by<F>(vec: [T; SIZE], compare: F) -> Self::Output
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
fn from_sort_by_key<B, F>(vec: [T; SIZE], f: F) -> Self::Output
Builds a permutation by sorting a slice-like type with a key function.
Source§impl<T, const SIZE: usize> PermFromSorting<Vec<T>, T> for PermS<SIZE>
impl<T, const SIZE: usize> PermFromSorting<Vec<T>, T> for PermS<SIZE>
type Output = Option<Perm<Static<SIZE>>>
Source§fn from_sort(vec: Vec<T>) -> Self::Outputwhere
T: Ord,
fn from_sort(vec: Vec<T>) -> Self::Outputwhere
T: Ord,
Builds a permutation by sorting a slice-like type.
Source§fn from_sort_by<F>(vec: Vec<T>, compare: F) -> Self::Output
fn from_sort_by<F>(vec: Vec<T>, compare: F) -> Self::Output
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
fn from_sort_by_key<B, F>(vec: Vec<T>, f: F) -> Self::Output
Builds a permutation by sorting a slice-like type with a key function.