Normalize

Trait Normalize 

Source
pub trait Normalize: Sized {
    type Elements: Set;
    type Color: Ord;
    type Cache;
    type Morphed: Ord;

    // Required methods
    fn initialize_cache(&self) -> Self::Cache;
    fn elements(&self) -> &Self::Elements;
    fn initial_coloring(&self) -> <Self::Elements as Set>::Map<Self::Color>;
    fn apply_morphism<F>(&self, morphism: F) -> Self::Morphed
       where F: Fn(&<Self::Elements as Set>::Item) -> usize;

    // Provided methods
    fn refine_coloring(
        &self,
        _cache: &mut Self::Cache,
        _coloring: &mut ReversibleColoring<Self::Elements>,
    ) { ... }
    fn normal_form(&self) -> Self::Morphed
       where <Self::Elements as Set>::Map<usize>: Clone { ... }
    fn canonical_permutation(&self) -> <Self::Elements as Set>::Map<usize>
       where <Self::Elements as Set>::Map<usize>: Clone { ... }
    fn normalize(&self) -> (Self::Morphed, <Self::Elements as Set>::Map<usize>)
       where <Self::Elements as Set>::Map<usize>: Clone { ... }
}
Expand description

Type for which a canonical form can be found.

Required Associated Types§

Source

type Elements: Set

Set of elements that can be permuted in order to find the canonical form.

Source

type Color: Ord

Initial coloring of the permutable elements.

Source

type Cache

Cached data used to refine the coloring at each step.

You can put in there the result of preliminary computations and allocations.

Source

type Morphed: Ord

Required Methods§

Source

fn initialize_cache(&self) -> Self::Cache

Initialize the cache.

This is the place to perform preliminary computations and allocations that will be useful every time the coloring must be refined.

Source

fn elements(&self) -> &Self::Elements

Returns a reference to the permutable elements.

Source

fn initial_coloring(&self) -> <Self::Elements as Set>::Map<Self::Color>

Returns the initial coloring of the permutable elements.

Source

fn apply_morphism<F>(&self, morphism: F) -> Self::Morphed
where F: Fn(&<Self::Elements as Set>::Item) -> usize,

Apply the given morphism.

Provided Methods§

Source

fn refine_coloring( &self, _cache: &mut Self::Cache, _coloring: &mut ReversibleColoring<Self::Elements>, )

Refine the current coloring.

Source

fn normal_form(&self) -> Self::Morphed
where <Self::Elements as Set>::Map<usize>: Clone,

Computes the canonical form of this object.

Source

fn canonical_permutation(&self) -> <Self::Elements as Set>::Map<usize>
where <Self::Elements as Set>::Map<usize>: Clone,

Computes the canonical permutation of this object.

Source

fn normalize(&self) -> (Self::Morphed, <Self::Elements as Set>::Map<usize>)
where <Self::Elements as Set>::Map<usize>: Clone,

Computes the canonical form of this object, with the associated permutation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§