pub struct Hypergraph<N> { /* private fields */ }Implementations§
Source§impl<N> Hypergraph<N>
impl<N> Hypergraph<N>
pub fn new() -> Self
pub fn add_node(&mut self, data: N, position: Vec2) -> NodeId
pub fn add_hyperedge(&mut self, members: Vec<NodeId>) -> HyperedgeId
pub fn add_hyperedge_colored( &mut self, members: Vec<NodeId>, color: [f32; 4], ) -> HyperedgeId
pub fn remove_node(&mut self, id: NodeId)
pub fn remove_hyperedge(&mut self, id: HyperedgeId)
pub fn node_count(&self) -> usize
pub fn hyperedge_count(&self) -> usize
pub fn get_node(&self, id: NodeId) -> Option<&HypernodeData<N>>
pub fn get_hyperedge(&self, id: HyperedgeId) -> Option<&HyperedgeData>
pub fn node_ids(&self) -> Vec<NodeId>
pub fn hyperedge_ids(&self) -> Vec<HyperedgeId>
Sourcepub fn convex_hull(&self, he_id: HyperedgeId) -> Vec<Vec2>
pub fn convex_hull(&self, he_id: HyperedgeId) -> Vec<Vec2>
Compute convex hull of member node positions for rendering a hyperedge.
Sourcepub fn to_bipartite(&self) -> Graph<String, ()>where
N: Debug,
pub fn to_bipartite(&self) -> Graph<String, ()>where
N: Debug,
Convert hypergraph to bipartite graph representation. Each hyperedge becomes a node, connected to all its member nodes.
Sourcepub fn from_bipartite(graph: &Graph<String, ()>) -> Hypergraph<String>
pub fn from_bipartite(graph: &Graph<String, ()>) -> Hypergraph<String>
Create a hypergraph from a bipartite graph. Nodes labeled “hedge_*” become hyperedges, others become nodes.
Trait Implementations§
Source§impl<N: Clone> Clone for Hypergraph<N>
impl<N: Clone> Clone for Hypergraph<N>
Source§fn clone(&self) -> Hypergraph<N>
fn clone(&self) -> Hypergraph<N>
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 moreAuto Trait Implementations§
impl<N> Freeze for Hypergraph<N>
impl<N> RefUnwindSafe for Hypergraph<N>where
N: RefUnwindSafe,
impl<N> Send for Hypergraph<N>where
N: Send,
impl<N> Sync for Hypergraph<N>where
N: Sync,
impl<N> Unpin for Hypergraph<N>where
N: Unpin,
impl<N> UnsafeUnpin for Hypergraph<N>
impl<N> UnwindSafe for Hypergraph<N>where
N: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.