pub struct OpenHypergraph<K: ArrayKind, O, A> {
pub s: FiniteFunction<K>,
pub t: FiniteFunction<K>,
pub h: Hypergraph<K, O, A>,
}
Expand description
Open Hypergraphs
§Invariants
We must have the following invariants:
These are checked by the OpenHypergraph::validate
method
§Panics
Most operations assume the invariants hold, and will panic if not.
Fields§
§s: FiniteFunction<K>
§t: FiniteFunction<K>
§h: Hypergraph<K, O, A>
Implementations§
Source§impl<K: ArrayKind, O, A> OpenHypergraph<K, O, A>
impl<K: ArrayKind, O, A> OpenHypergraph<K, O, A>
pub fn new( s: FiniteFunction<K>, t: FiniteFunction<K>, h: Hypergraph<K, O, A>, ) -> Result<Self, InvalidOpenHypergraph<K>>
pub fn validate(self) -> Result<Self, InvalidOpenHypergraph<K>>
pub fn singleton( x: A, a: SemifiniteFunction<K, O>, b: SemifiniteFunction<K, O>, ) -> OpenHypergraph<K, O, A>
pub fn tensor_operations( operations: Operations<K, O, A>, ) -> OpenHypergraph<K, O, A>
pub fn source(&self) -> SemifiniteFunction<K, O>
pub fn target(&self) -> SemifiniteFunction<K, O>
pub fn identity(w: SemifiniteFunction<K, O>) -> OpenHypergraph<K, O, A>
pub fn spider( s: FiniteFunction<K>, t: FiniteFunction<K>, w: SemifiniteFunction<K, O>, ) -> Option<Self>
Trait Implementations§
Source§impl<K: ArrayKind, O, A> Arrow for OpenHypergraph<K, O, A>
impl<K: ArrayKind, O, A> Arrow for OpenHypergraph<K, O, A>
Source§impl<K: ArrayKind, O, A> BitOr<&OpenHypergraph<K, O, A>> for &OpenHypergraph<K, O, A>
impl<K: ArrayKind, O, A> BitOr<&OpenHypergraph<K, O, A>> for &OpenHypergraph<K, O, A>
Source§type Output = OpenHypergraph<K, O, A>
type Output = OpenHypergraph<K, O, A>
The resulting type after applying the
|
operator.Source§fn bitor(self, rhs: &OpenHypergraph<K, O, A>) -> OpenHypergraph<K, O, A>
fn bitor(self, rhs: &OpenHypergraph<K, O, A>) -> OpenHypergraph<K, O, A>
Performs the
|
operation. Read moreSource§impl<K: ArrayKind, O, A> Clone for OpenHypergraph<K, O, A>
impl<K: ArrayKind, O, A> Clone for OpenHypergraph<K, O, A>
Source§impl<K: ArrayKind, O, A> Monoidal for OpenHypergraph<K, O, A>
impl<K: ArrayKind, O, A> Monoidal for OpenHypergraph<K, O, A>
Source§impl<K: ArrayKind, O, A> Shr<&OpenHypergraph<K, O, A>> for &OpenHypergraph<K, O, A>
impl<K: ArrayKind, O, A> Shr<&OpenHypergraph<K, O, A>> for &OpenHypergraph<K, O, A>
Source§type Output = Option<OpenHypergraph<K, O, A>>
type Output = Option<OpenHypergraph<K, O, A>>
The resulting type after applying the
>>
operator.Source§fn shr(self, rhs: &OpenHypergraph<K, O, A>) -> Option<OpenHypergraph<K, O, A>>
fn shr(self, rhs: &OpenHypergraph<K, O, A>) -> Option<OpenHypergraph<K, O, A>>
Performs the
>>
operation. Read moreSource§impl<K: ArrayKind, O, A> Spider<K> for OpenHypergraph<K, O, A>
impl<K: ArrayKind, O, A> Spider<K> for OpenHypergraph<K, O, A>
Source§fn dagger(&self) -> Self
fn dagger(&self) -> Self
Given an
Arrow
with type f : A → B
,
construct its dagger f† : B → A
by using Hypergraph structure to bend sources to targets and vice-versa.Source§fn spider(
s: FiniteFunction<K>,
t: FiniteFunction<K>,
w: Self::Object,
) -> Option<Self>
fn spider( s: FiniteFunction<K>, t: FiniteFunction<K>, w: Self::Object, ) -> Option<Self>
Construct a spider using a type
w
, and source s
and target t
interface maps.Source§fn half_spider(s: FiniteFunction<K>, w: Self::Object) -> Option<Self>
fn half_spider(s: FiniteFunction<K>, w: Self::Object) -> Option<Self>
Construct a “half-spider”: a spider whose
t
leg is identity.Auto Trait Implementations§
impl<K, O, A> Freeze for OpenHypergraph<K, O, A>
impl<K, O, A> RefUnwindSafe for OpenHypergraph<K, O, A>where
<K as ArrayKind>::Index: RefUnwindSafe,
<K as ArrayKind>::I: RefUnwindSafe,
<K as ArrayKind>::Type<O>: RefUnwindSafe,
<K as ArrayKind>::Type<A>: RefUnwindSafe,
impl<K, O, A> Send for OpenHypergraph<K, O, A>
impl<K, O, A> Sync for OpenHypergraph<K, O, A>
impl<K, O, A> Unpin for OpenHypergraph<K, O, A>
impl<K, O, A> UnwindSafe for OpenHypergraph<K, O, A>where
<K as ArrayKind>::Index: UnwindSafe,
<K as ArrayKind>::I: UnwindSafe,
<K as ArrayKind>::Type<O>: UnwindSafe,
<K as ArrayKind>::Type<A>: 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