Rosetta
|
An Node class for LowMemGraph. Will often be overriden @detail Be careful with this class! It doesn't use actual virtual functions. Never do this: LowMemNodeOP op = MyDerivedNodeOP() Instead, if you wish to use an owning pointer, you must do this: MyDerivedNodeOP op = MyDerivedNodeOP() More...
#include <LowMemGraph.hh>
Public Member Functions | |
LowMemNode (uint32_t node_index) | |
~LowMemNode () | |
This class should have a virtual destructor. But adding virtual functions adds an extra 8 bytes per class. Be careful!!! More... | |
void | drop_all_edges (LowMemGraphBase &graph) |
deletes all edges incident upon this node More... | |
LowMemEdge const * | find_edge (uint32_t other_node_ind, LowMemGraphBase const &graph) const |
a "slow" (linear) search for an edge. More... | |
LowMemEdge * | find_edge (uint32_t other_node_ind, LowMemGraphBase &graph) |
a "slow" (linear) search for an edge. More... | |
void | print () const |
send summaray data about this node to the screen More... | |
LowMemEdgeListIter | edge_list_begin (LowMemGraphBase &graph) |
returns a non-const iterator to the beginning of its edge list More... | |
LowMemEdgeListConstIter | const_edge_list_begin (LowMemGraphBase const &graph) const |
returns a const iterator to the beginning of its edge list More... | |
LowMemEdgeListIter | edge_list_end (LowMemGraphBase &graph) |
returns a non-const iterator to the end of its edge list More... | |
LowMemEdgeListConstIter | const_edge_list_end (LowMemGraphBase const &graph) const |
returns a const iterator to the end of its edge list More... | |
uint32_t | get_node_index () const |
the index for this node More... | |
platform::Size | num_edges () const |
the number of edges incident on this node, which may include a loop edge More... | |
platform::Size | count_static_memory () const |
how much memory is statically allocated by this node More... | |
platform::Size | count_dynamic_memory () const |
how much memory is dynamically allocated by this node – must be recursively invoked by a derived class. More... | |
void | internal_add_edge (platform::Size edge_offset) |
Don't call this!!!. Adds an edge from the edge list to this node @detail Only made public so we don't have to friend the templated LowMemGraph. More... | |
platform::Size | internal_drop_edge (LowMemEdge const *edge, LowMemGraphBase const &graph) |
Don't call this!!!. It only locally deletes the edge from this node. @detail Only made public so we don't have to friend the templated LowMemGraph. Returns offset in the global edge list. More... | |
std::vector< platform::Size > const & | internal_get_edge_list () const |
Don't call this!!!. Only to be used by LowMemGraph @detail Only made public so we don't have to friend the templated LowMemGraph. More... | |
Protected Member Functions | |
LowMemEdge * | internal_get_edge (platform::Size local_offset, LowMemGraphBase &graph) |
LowMemEdge const * | internal_get_edge (platform::Size local_offset, LowMemGraphBase const &graph) const |
platform::Size | internal_find_edge (uint32_t other_node_ind, LowMemGraphBase const &graph) const |
Private Attributes | |
std::vector< platform::Size > | edge_vec_ |
uint32_t | node_index_ |
Friends | |
class | LowMemEdgeListIter |
class | LowMemEdgeListConstIter |
An Node class for LowMemGraph. Will often be overriden @detail Be careful with this class! It doesn't use actual virtual functions. Never do this: LowMemNodeOP op = MyDerivedNodeOP() Instead, if you wish to use an owning pointer, you must do this: MyDerivedNodeOP op = MyDerivedNodeOP()
Having any virtual functions increases a class's footprint by 8 bytes
See core/scoring/hbonds/graph/HBondGraph.hh for example
|
inline |
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!!!
|
inline |
returns a const iterator to the beginning of its edge list
References LowMemEdgeListConstIter.
|
inline |
returns a const iterator to the end of its edge list
References LowMemEdgeListConstIter, and num_edges().
Size utility::graph::LowMemNode::count_dynamic_memory | ( | ) | const |
how much memory is dynamically allocated by this node – 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()
References edge_vec_.
Size utility::graph::LowMemNode::count_static_memory | ( | ) | const |
how much memory is statically allocated by this node
memory accounting scheme
This function isn't technically virtual, but if you override it, your code WILL be called by getTotalMemoryUsage()
References LowMemNode().
void utility::graph::LowMemNode::drop_all_edges | ( | LowMemGraphBase & | graph | ) |
deletes all edges incident upon this node
Although edges are deleted, the memory for the edges is not freed.
References utility::graph::LowMemGraphBase::drop_all_edges_for_node(), and get_node_index().
|
inline |
returns a non-const iterator to the beginning of its edge list
References LowMemEdgeListIter.
|
inline |
returns a non-const iterator to the end of its edge list
References LowMemEdgeListIter, and num_edges().
LowMemEdge * utility::graph::LowMemNode::find_edge | ( | uint32_t | other_node_ind, |
LowMemGraphBase & | graph | ||
) |
a "slow" (linear) search for an edge.
References edge_vec_, utility::graph::LowMemEdge::get_first_node_ind(), utility::graph::LowMemEdge::get_second_node_ind(), utility::graph::LowMemGraphBase::internal_get_edge(), and offset.
LowMemEdge const * utility::graph::LowMemNode::find_edge | ( | uint32_t | other_node_ind, |
LowMemGraphBase const & | graph | ||
) | const |
a "slow" (linear) search for an edge.
References edge_vec_, utility::graph::LowMemEdge::get_first_node_ind(), utility::graph::LowMemEdge::get_second_node_ind(), utility::graph::LowMemGraphBase::internal_get_edge(), and offset.
|
inline |
the index for this node
References node_index_.
Referenced by drop_all_edges(), and internal_drop_edge().
void utility::graph::LowMemNode::internal_add_edge | ( | platform::Size | edge_offset | ) |
Don't call this!!!. Adds an edge from the edge list to this node @detail Only made public so we don't have to friend the templated LowMemGraph.
References edge_vec_.
Size utility::graph::LowMemNode::internal_drop_edge | ( | LowMemEdge const * | edge, |
LowMemGraphBase const & | graph | ||
) |
Don't call this!!!. It only locally deletes the edge from this node. @detail Only made public so we don't have to friend the templated LowMemGraph. Returns offset in the global edge list.
References edge_vec_, get_node_index(), utility::graph::LowMemEdge::get_other_ind(), and internal_find_edge().
|
protected |
|
protected |
|
protected |
|
inline |
Don't call this!!!. Only to be used by LowMemGraph @detail Only made public so we don't have to friend the templated LowMemGraph.
References edge_vec_.
|
inline |
the number of edges incident on this node, which may include a loop edge
References edge_vec_.
Referenced by const_edge_list_end(), edge_list_end(), utility::graph::LowMemEdgeListIter::valid(), and utility::graph::LowMemEdgeListConstIter::valid().
|
inline |
send summaray data about this node to the screen
This function isn't technically virtual, but if you override it, your code WILL be called by print_vertices()
|
friend |
Referenced by const_edge_list_begin(), and const_edge_list_end().
|
friend |
Referenced by edge_list_begin(), and edge_list_end().
|
private |
|
private |
Referenced by get_node_index().