Skip to main content

GraphExpressions

Trait GraphExpressions 

Source
pub trait GraphExpressions<E, V> {
    // Required methods
    fn try_fold_numerator<S: SubGraphLike + SubSetOps, N, Error>(
        &self,
        subgraph: &S,
        without: &S,
        unit: N,
        vertex_numerator: impl Fn(NodeIndex, &V) -> N,
        edge_numerator: impl Fn(&E) -> N,
        is_dummy: impl Fn(&E) -> bool,
        product: impl FnMut(N, N) -> Result<N, Error>,
    ) -> Result<N, Error>;
    fn denominator_of<S: SubGraphLike, Error>(
        &self,
        subgraph: &S,
        propagator: impl Fn(EdgeIndex, &E) -> Result<Atom, Error>,
        edge_power: impl Fn(EdgeIndex, &E) -> isize,
    ) -> Result<Atom, Error>;

    // Provided method
    fn numerator_of<S: SubGraphLike + SubSetOps>(
        &self,
        subgraph: &S,
        without: &S,
        vertex_numerator: impl Fn(NodeIndex, &V) -> Atom,
        edge_numerator: impl Fn(&E) -> Atom,
        is_dummy: impl Fn(&E) -> bool,
    ) -> Atom { ... }
}
Expand description

Application data access is supplied by callers; the selection rules are shared.

Required Methods§

Source

fn try_fold_numerator<S: SubGraphLike + SubSetOps, N, Error>( &self, subgraph: &S, without: &S, unit: N, vertex_numerator: impl Fn(NodeIndex, &V) -> N, edge_numerator: impl Fn(&E) -> N, is_dummy: impl Fn(&E) -> bool, product: impl FnMut(N, N) -> Result<N, Error>, ) -> Result<N, Error>

Compose selected local fragments without erasing their owning value type. Selection and dummy-edge rules are identical for source atoms and retained tensors.

Source

fn denominator_of<S: SubGraphLike, Error>( &self, subgraph: &S, propagator: impl Fn(EdgeIndex, &E) -> Result<Atom, Error>, edge_power: impl Fn(EdgeIndex, &E) -> isize, ) -> Result<Atom, Error>

Only edges paired inside the selection contribute a propagator. Powers may be negative or zero, and the factor callback is not run for zero powers.

Provided Methods§

Source

fn numerator_of<S: SubGraphLike + SubSetOps>( &self, subgraph: &S, without: &S, vertex_numerator: impl Fn(NodeIndex, &V) -> Atom, edge_numerator: impl Fn(&E) -> Atom, is_dummy: impl Fn(&E) -> bool, ) -> Atom

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<E, V, H> GraphExpressions<E, V> for HedgeGraph<E, V, H>

Source§

fn try_fold_numerator<S: SubGraphLike + SubSetOps, N, Error>( &self, subgraph: &S, without: &S, unit: N, vertex_numerator: impl Fn(NodeIndex, &V) -> N, edge_numerator: impl Fn(&E) -> N, is_dummy: impl Fn(&E) -> bool, product: impl FnMut(N, N) -> Result<N, Error>, ) -> Result<N, Error>

Source§

fn denominator_of<S: SubGraphLike, Error>( &self, subgraph: &S, propagator: impl Fn(EdgeIndex, &E) -> Result<Atom, Error>, edge_power: impl Fn(EdgeIndex, &E) -> isize, ) -> Result<Atom, Error>

Implementors§