Struct caffe2_nomnigraph::Subgraph
source · pub struct Subgraph<T, U = EmptyEdgeData> { /* private fields */ }
Expand description
| ———– | @brief | | Effectively a constant reference to | a graph. | | ———– | @note | | A Subgraph could actually point to an | entire NomGraph. | | Subgraphs can only contain references | to nodes/edges in a NomGraph. | | They are technically mutable, but this | should be viewed as a construction helper | rather than a fact to be exploited. There | are no deleters, for example. |
Implementations§
source§impl<T, U> Subgraph<T, U>
impl<T, U> Subgraph<T, U>
pub fn add_node(&mut self, n: NodeRef<T, U>)
pub fn has_node(&self, n: NodeRef<T, U>) -> bool
pub fn remove_node(&mut self, n: NodeRef<T, U>)
pub fn add_edge(&mut self, e: EdgeRef<T, U>)
pub fn has_edge(&self, e: EdgeRef<T, U>) -> bool
pub fn remove_edge(&mut self, e: EdgeRef<T, U>)
pub fn get_nodes(&self) -> &HashSet<NodeRef<T, U>>
pub fn get_nodes_count(&self) -> usize
pub fn get_edges(&self) -> &HashSet<EdgeRef<T, U>>
pub fn print_edges(&mut self)
pub fn print_nodes(&self)
Trait Implementations§
Auto Trait Implementations§
impl<T, U> RefUnwindSafe for Subgraph<T, U>where T: RefUnwindSafe, U: RefUnwindSafe,
impl<T, U = EmptyEdgeData> !Send for Subgraph<T, U>
impl<T, U = EmptyEdgeData> !Sync for Subgraph<T, U>
impl<T, U> Unpin for Subgraph<T, U>
impl<T, U> UnwindSafe for Subgraph<T, U>where T: RefUnwindSafe, U: RefUnwindSafe,
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.