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§
Sourcetype Cache
type Cache
Cached data used to refine the coloring at each step.
You can put in there the result of preliminary computations and allocations.
type Morphed: Ord
Required Methods§
Sourcefn initialize_cache(&self) -> Self::Cache
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.
Provided Methods§
Sourcefn refine_coloring(
&self,
_cache: &mut Self::Cache,
_coloring: &mut ReversibleColoring<Self::Elements>,
)
fn refine_coloring( &self, _cache: &mut Self::Cache, _coloring: &mut ReversibleColoring<Self::Elements>, )
Refine the current coloring.
Sourcefn normal_form(&self) -> Self::Morphed
fn normal_form(&self) -> Self::Morphed
Computes the canonical form of this object.
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.