pub struct ResGraphMorphism<S: ResGraphObject, T: ResGraphObject> {
pub mapping: HashMap<usize, usize>,
/* private fields */
}Expand description
A morphism in the ResGraph category
A morphism f: A → B is a graph homomorphism that:
- Maps vertices of A to vertices of B
- Preserves adjacency: if
v~win A, thenf(v)~f(w)in B - Preserves resonance structure (compatibility with E₈)
§Type Parameters
S- Source object typeT- Target object type
The phantom types ensure type safety: you can only compose morphisms where the target of the first equals the source of the second.
Fields§
§mapping: HashMap<usize, usize>Vertex mapping: source vertex → target vertex
Implementations§
Source§impl<S: ResGraphObject, T: ResGraphObject> ResGraphMorphism<S, T>
impl<S: ResGraphObject, T: ResGraphObject> ResGraphMorphism<S, T>
Sourcepub fn identity(object: &S) -> ResGraphMorphism<S, S>
pub fn identity(object: &S) -> ResGraphMorphism<S, S>
Sourcepub fn num_vertices(&self) -> usize
pub fn num_vertices(&self) -> usize
Get the number of vertices in the source
Sourcepub fn compose<U: ResGraphObject>(
&self,
next: &ResGraphMorphism<T, U>,
) -> ResGraphMorphism<S, U>
pub fn compose<U: ResGraphObject>( &self, next: &ResGraphMorphism<T, U>, ) -> ResGraphMorphism<S, U>
Trait Implementations§
Source§impl<S: Clone + ResGraphObject, T: Clone + ResGraphObject> Clone for ResGraphMorphism<S, T>
impl<S: Clone + ResGraphObject, T: Clone + ResGraphObject> Clone for ResGraphMorphism<S, T>
Source§fn clone(&self) -> ResGraphMorphism<S, T>
fn clone(&self) -> ResGraphMorphism<S, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S: Debug + ResGraphObject, T: Debug + ResGraphObject> Debug for ResGraphMorphism<S, T>
impl<S: Debug + ResGraphObject, T: Debug + ResGraphObject> Debug for ResGraphMorphism<S, T>
Auto Trait Implementations§
impl<S, T> Freeze for ResGraphMorphism<S, T>
impl<S, T> RefUnwindSafe for ResGraphMorphism<S, T>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<S, T> Send for ResGraphMorphism<S, T>
impl<S, T> Sync for ResGraphMorphism<S, T>
impl<S, T> Unpin for ResGraphMorphism<S, T>
impl<S, T> UnwindSafe for ResGraphMorphism<S, T>where
S: UnwindSafe,
T: 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