Skip to main content

check_relationship_edges

Function check_relationship_edges 

Source
pub fn check_relationship_edges<C: Eq + Hash>(
    methods: &[(&[C], &[C])],
) -> Result<(), &'static str>
Expand description

Checks ordinary relationship edge structure without constructing methods or a live sheet.

Every method must have distinct, nonempty outputs and reference the same union of input/output cells. Output sets of different methods cannot be equal or nested. Inputs may overlap outputs. This check neither specializes sources nor plans a graph.

§Errors

Returns the violated structural rule.

  • Complexity: O(m²e) time and O(me) space for m methods of at most e edges.

§Examples

use adam_rs::template::check_relationship_edges;
assert!(check_relationship_edges(&[(&[0usize][..], &[1usize][..]),
    (&[1usize][..], &[0usize][..])]).is_ok());