pub struct Hypergraph<K: ArrayKind, O, A> {
pub s: IndexedCoproduct<K, FiniteFunction<K>>,
pub t: IndexedCoproduct<K, FiniteFunction<K>>,
pub w: SemifiniteFunction<K, O>,
pub x: SemifiniteFunction<K, A>,
}
Fields§
§s: IndexedCoproduct<K, FiniteFunction<K>>
§t: IndexedCoproduct<K, FiniteFunction<K>>
§w: SemifiniteFunction<K, O>
§x: SemifiniteFunction<K, A>
Implementations§
Source§impl<K: ArrayKind, O, A> Hypergraph<K, O, A>
impl<K: ArrayKind, O, A> Hypergraph<K, O, A>
Sourcepub fn new(
s: IndexedCoproduct<K, FiniteFunction<K>>,
t: IndexedCoproduct<K, FiniteFunction<K>>,
w: SemifiniteFunction<K, O>,
x: SemifiniteFunction<K, A>,
) -> Result<Hypergraph<K, O, A>, InvalidHypergraph<K>>
pub fn new( s: IndexedCoproduct<K, FiniteFunction<K>>, t: IndexedCoproduct<K, FiniteFunction<K>>, w: SemifiniteFunction<K, O>, x: SemifiniteFunction<K, A>, ) -> Result<Hypergraph<K, O, A>, InvalidHypergraph<K>>
Safely create a Hypergraph, ensuring its data is valid.
Sourcepub fn validate(self) -> Result<Self, InvalidHypergraph<K>>
pub fn validate(self) -> Result<Self, InvalidHypergraph<K>>
A hypergraph is valid when for both sources and targets segmented arrays:
- Number of segments is equal to number of operations (
x.len()
) - Values of segmented array are indices in set
w.source()
Sourcepub fn empty() -> Hypergraph<K, O, A>
pub fn empty() -> Hypergraph<K, O, A>
Construct the empty hypergraph with no nodes and no hyperedges.
Sourcepub fn discrete(w: SemifiniteFunction<K, O>) -> Hypergraph<K, O, A>
pub fn discrete(w: SemifiniteFunction<K, O>) -> Hypergraph<K, O, A>
The discrete hypergraph, consisting of hypernodes labeled in O
.
pub fn is_discrete(&self) -> bool
pub fn coequalize_vertices( &self, q: &FiniteFunction<K>, ) -> Option<Hypergraph<K, O, A>>
pub fn coproduct(&self, other: &Self) -> Self
pub fn tensor_operations(_: Operations<K, O, A>) -> Hypergraph<K, O, A>
Trait Implementations§
Source§impl<K: ArrayKind, O, A> Add<&Hypergraph<K, O, A>> for &Hypergraph<K, O, A>
impl<K: ArrayKind, O, A> Add<&Hypergraph<K, O, A>> for &Hypergraph<K, O, A>
Source§type Output = Hypergraph<K, O, A>
type Output = Hypergraph<K, O, A>
The resulting type after applying the
+
operator.Source§impl<K: ArrayKind, O, A> Clone for Hypergraph<K, O, A>
impl<K: ArrayKind, O, A> Clone for Hypergraph<K, O, A>
Auto Trait Implementations§
impl<K, O, A> Freeze for Hypergraph<K, O, A>
impl<K, O, A> RefUnwindSafe for Hypergraph<K, O, A>where
<K as ArrayKind>::Type<O>: RefUnwindSafe,
<K as ArrayKind>::Type<A>: RefUnwindSafe,
<K as ArrayKind>::Index: RefUnwindSafe,
<K as ArrayKind>::I: RefUnwindSafe,
impl<K, O, A> Send for Hypergraph<K, O, A>
impl<K, O, A> Sync for Hypergraph<K, O, A>
impl<K, O, A> Unpin for Hypergraph<K, O, A>
impl<K, O, A> UnwindSafe for Hypergraph<K, O, A>where
<K as ArrayKind>::Type<O>: UnwindSafe,
<K as ArrayKind>::Type<A>: UnwindSafe,
<K as ArrayKind>::Index: UnwindSafe,
<K as ArrayKind>::I: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more