Skip to main content

GraphOrientation

Trait GraphOrientation 

Source
pub trait GraphOrientation: Sized {
    // Required method
    fn orientation(&self) -> &EdgeVec<Orientation>;

    // Provided methods
    fn orientation_thetas(&self) -> Atom { ... }
    fn orientation_delta(&self) -> Atom
       where Self: Sized { ... }
    fn select<'a>(&self, atom: impl Into<AtomOrView<'a>>) -> Atom { ... }
    fn iterate<'a>(&'a self) -> EdgeVecIter<'a, Orientation> { ... }
    fn get(&self, index: EdgeIndex) -> Orientation { ... }
    fn is_compatible_with(&self, reference: &Self) -> bool { ... }
    fn score(&self, internal_edges: &[EdgeIndex]) -> RepresentativeScore { ... }
    fn select_representative_orientation<'b>(
        self,
        valid_global_orientations: &'b [Self],
        internal_edges: &[EdgeIndex],
    ) -> Result<&'b Self> { ... }
    fn internal_orientation_selector(
        &self,
        internal_edges: &[EdgeIndex],
    ) -> Atom { ... }
}

Required Methods§

Source

fn orientation(&self) -> &EdgeVec<Orientation>

Provided Methods§

Source

fn orientation_thetas(&self) -> Atom

Source

fn orientation_delta(&self) -> Atom
where Self: Sized,

Source

fn select<'a>(&self, atom: impl Into<AtomOrView<'a>>) -> Atom

Source

fn iterate<'a>(&'a self) -> EdgeVecIter<'a, Orientation>

Source

fn get(&self, index: EdgeIndex) -> Orientation

Source

fn is_compatible_with(&self, reference: &Self) -> bool

Returns true if the orientation matches the reference, ignoring Undirected edges of the reference.

Source

fn score(&self, internal_edges: &[EdgeIndex]) -> RepresentativeScore

Source

fn select_representative_orientation<'b>( self, valid_global_orientations: &'b [Self], internal_edges: &[EdgeIndex], ) -> Result<&'b Self>

Select the deterministic full-graph representative used to host the integrated UV term.

The reduced orientation already fixes all edges that remain explicit after contracting the integrated subgraph. Any contracted edge appears as Undirected and is therefore ignored when matching compatible full orientations.

Among the compatible candidates, the representative is chosen by maximizing:

  1. the number of Undirected internal edges
  2. then the number of Default internal edges
  3. then the lexicographically maximal is_default pattern in ascending internal-edge order

The first criterion is currently future-proof only: the canonical full-graph acyclic basis is built from Default / Reversed assignments on paired internal edges, so Undirected internal entries are not expected there unless the global orientation-generation step changes.

Source

fn internal_orientation_selector(&self, internal_edges: &[EdgeIndex]) -> Atom

Build only the selector factors for the internal edges of the integrated subgraph.

This intentionally does not use orientation_thetas() on the whole representative orientation. The reduced-graph CFF term already carries selectors for the edges that remain explicit after contraction, so re-applying them here would duplicate selectors on external edges.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl GraphOrientation for EdgeVec<Orientation>

Source§

fn orientation(&self) -> &EdgeVec<Orientation>

Implementors§