Trait flag_algebra::Flag

source ·
pub trait Flag{
    const NAME: &'static str;
    const HEREDITARY: bool = true;

    // Required methods
    fn induce(&self, set: &[usize]) -> Self;
    fn size_zero_flags() -> Vec<Self>;
    fn superflags(&self) -> Vec<Self>;

    // Provided methods
    fn generate_next(previous: &[Self]) -> Vec<Self> { ... }
    fn generate(n: usize) -> Vec<Self> { ... }
    fn generate_typed_up(type_flag: &Self, g_vec: &[Self]) -> Vec<Self> { ... }
    fn generate_typed(type_flag: &Self, size: usize) -> Vec<Self> { ... }
    fn select_type(&self, eta: &[usize]) -> Self { ... }
}
Expand description

Trait for combinatorial objects that can be used as flags.

Flags must implement the Canonize trait from the canonical_form crate, that allows reduction modulo isomorphism.

Required Associated Constants§

source

const NAME: &'static str

A unique name for this type of flags. For instance “Graph”. This nameis used for naming the associated data subdirectory.

Provided Associated Constants§

source

const HEREDITARY: bool = true

Setting this parameter to false deactivate checks that induced subflags exists. Must be true in every classic case.

Required Methods§

source

fn induce(&self, set: &[usize]) -> Self

Returns the subflag induced by the vertices in the slice set.

source

fn size_zero_flags() -> Vec<Self>

Returns the set of all flags of size 0.

This list is used for initialisation in the flag construction.

source

fn superflags(&self) -> Vec<Self>

Return the list of flags of size self.size() + 1 that contain self as an induced subflag.

This list can have redundancy and is a priori not reduced modulo isomorphism.

Provided Methods§

source

fn generate_next(previous: &[Self]) -> Vec<Self>

Return the list of flags of size self.size() + 1 that contain self as an induced subflag reduced modulo isomorphism.

source

fn generate(n: usize) -> Vec<Self>

Return the list of flags of size n reduced modulo isomorphism.

source

fn generate_typed_up(type_flag: &Self, g_vec: &[Self]) -> Vec<Self>

Return the list of flags of g_vec that can be rooted on the flag type_flag. Each different way to root this flag give a different flag in the result.

source

fn generate_typed(type_flag: &Self, size: usize) -> Vec<Self>

Return the list of flag of size size rooted on type_flag reduced modulo (typed) isomorphism.

source

fn select_type(&self, eta: &[usize]) -> Self

Reorder self so that the eta.len() first vertices are the values of eta in the corresponding order.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Flag for DirectedGraph

source§

const NAME: &'static str = "DirectedGraph"

source§

impl Flag for Graph

source§

const NAME: &'static str = "Graph"

source§

impl Flag for OrientedGraph

source§

const NAME: &'static str = "OrientedGraph"

source§

impl<F, A> Flag for SubClass<F, A>
where A: SubFlag<F>, F: Flag,

source§

const NAME: &'static str = A::SUBCLASS_NAME

source§

const HEREDITARY: bool = A::HEREDITARY

source§

impl<F, const N: u8> Flag for Colored<F, N>
where F: Flag,

source§

const NAME: &'static str = "FIXME"

source§

const HEREDITARY: bool = F::HEREDITARY

source§

impl<const K: u8> Flag for CGraph<K>

source§

const NAME: &'static str = _