Rosetta
|
An Edge class for LowMemGraph. Will often be overriden. @detail Be careful with this class! It doesn't use actual virtual functions. Never do this: LowMemEdgeOP op = MyDerivedEdgeOP() Instead, if you wish to use an owning pointer, you must do this: MyDerivedEdgeOP op = MyDerivedEdgeOP() More...
#include <LowMemGraph.hh>
Public Member Functions | |
LowMemEdge (uint32_t first_node_ind, uint32_t second_node_ind) | |
Main edge constructor. This should only be invoked by create_new_edge, which itself is only called by add_edge. The ONLY way an edge should be added to a graph is through add_edge. NOTE: edges should be only be deleted by a call to the Graph's delete_edge method. More... | |
~LowMemEdge () | |
This class should have a virtual destructor. But adding virtual functions adds an extra 8 bytes per class. Be careful!!! More... | |
uint32_t | get_other_ind (uint32_t node_ind) const |
returns the index of the one node given the index of the other. node_index must be one of the two nodes that this edge is incident upon. More... | |
LowMemNode const * | get_other_node (uint32_t node_index, LowMemGraphBase const &graph) const |
returns a const pointer to one node given the index of the other. node_index must be one of the two nodes that this edge is incident upon. More... | |
LowMemNode * | get_other_node (uint32_t node_index, LowMemGraphBase &graph) |
returns a non-const pointer to one node given the index of the other. node_index must be one of the two nodes that this edge is incident upon. More... | |
uint32_t | get_first_node_ind () const |
returns the index of the lower node More... | |
uint32_t | get_second_node_ind () const |
returns the index of the upper node More... | |
bool | same_edge (uint32_t node1, uint32_t node2) const |
Is this the same edge as another edge (node1,node2)? Note: this graph does not work for multi-graphs. Edges must be unique. More... | |
platform::Size | count_static_memory () const |
how much memory is statically allocated by this edge More... | |
platform::Size | count_dynamic_memory () const |
how much memory is dynamically allocated by this edge – must be recursively invoked by a derived class. More... | |
void | internal_delete_self () |
Don't call this!!! Only to be called by LowMemGraph. More... | |
Protected Member Functions | |
bool | internal_deleted () const |
Private Attributes | |
uint32_t | first_node_ind_ |
uint32_t | second_node_ind_ |
Friends | |
class | LowMemEdgeListIter |
class | LowMemEdgeListConstIter |
An Edge class for LowMemGraph. Will often be overriden. @detail Be careful with this class! It doesn't use actual virtual functions. Never do this: LowMemEdgeOP op = MyDerivedEdgeOP() Instead, if you wish to use an owning pointer, you must do this: MyDerivedEdgeOP op = MyDerivedEdgeOP()
Having any virtual functions increases a class's footprint by 8 bytes
See core/scoring/hbonds/graph/HBondGraph.hh for example
Main edge constructor. This should only be invoked by create_new_edge, which itself is only called by add_edge. The ONLY way an edge should be added to a graph is through add_edge. NOTE: edges should be only be deleted by a call to the Graph's delete_edge method.
Referenced by count_static_memory().
|
inline |
This class should have a virtual destructor. But adding virtual functions adds an extra 8 bytes per class. Be careful!!!
Size utility::graph::LowMemEdge::count_dynamic_memory | ( | ) | const |
how much memory is dynamically allocated by this edge – must be recursively invoked by a derived class.
memory accounting scheme
This function isn't technically virtual, but if you override it, your code WILL be called by getTotalMemoryUsage()
Size utility::graph::LowMemEdge::count_static_memory | ( | ) | const |
how much memory is statically allocated by this edge
memory accounting scheme
This function isn't technically virtual, but if you override it, your code WILL be called by getTotalMemoryUsage()
References LowMemEdge().
|
inline |
returns the index of the lower node
References first_node_ind_.
Referenced by utility::graph::LowMemGraph< _LMNode, _LMEdge >::add_edge(), utility::graph::LowMemGraph< _LMNode, _LMEdge >::delete_edge(), utility::graph::LowMemNode::find_edge(), and utility::graph::LowMemNode::internal_find_edge().
returns the index of the one node given the index of the other. node_index must be one of the two nodes that this edge is incident upon.
References debug_assert, first_node_ind_, and second_node_ind_.
Referenced by utility::graph::LowMemNode::internal_drop_edge().
LowMemNode * utility::graph::LowMemEdge::get_other_node | ( | uint32_t | node_index, |
LowMemGraphBase & | graph | ||
) |
returns a non-const pointer to one node given the index of the other. node_index must be one of the two nodes that this edge is incident upon.
References debug_assert, first_node_ind_, utility::graph::LowMemGraphBase::get_node(), and second_node_ind_.
LowMemNode const * utility::graph::LowMemEdge::get_other_node | ( | uint32_t | node_index, |
LowMemGraphBase const & | graph | ||
) | const |
returns a const pointer to one node given the index of the other. node_index must be one of the two nodes that this edge is incident upon.
References debug_assert, first_node_ind_, utility::graph::LowMemGraphBase::get_node(), and second_node_ind_.
|
inline |
returns the index of the upper node
References second_node_ind_.
Referenced by utility::graph::LowMemGraph< _LMNode, _LMEdge >::add_edge(), utility::graph::LowMemGraph< _LMNode, _LMEdge >::delete_edge(), utility::graph::LowMemNode::find_edge(), and utility::graph::LowMemNode::internal_find_edge().
void utility::graph::LowMemEdge::internal_delete_self | ( | ) |
Don't call this!!! Only to be called by LowMemGraph.
References first_node_ind_, and second_node_ind_.
Referenced by utility::graph::LowMemGraph< _LMNode, _LMEdge >::delete_edge().
|
protected |
References debug_assert, first_node_ind_, and second_node_ind_.
Is this the same edge as another edge (node1,node2)? Note: this graph does not work for multi-graphs. Edges must be unique.
References first_node_ind_, second_node_ind_, and erraser_analysis::temp.
|
friend |
|
friend |
|
private |
Referenced by get_first_node_ind(), get_other_ind(), get_other_node(), internal_delete_self(), internal_deleted(), and same_edge().
|
private |
Referenced by get_other_ind(), get_other_node(), get_second_node_ind(), internal_delete_self(), internal_deleted(), and same_edge().