Rosetta 3.4
Public Types | Public Member Functions | Protected Member Functions
core::graph::Node Class Reference

#include <Graph.hh>

Inheritance diagram for core::graph::Node:
Inheritance graph
[legend]
Collaboration diagram for core::graph::Node:
Collaboration graph
[legend]

List of all members.

Public Types

typedef EdgeListIterator EdgeListIter
typedef EdgeListConstIterator EdgeListConstIter

Public Member Functions

virtual ~Node ()
 virtual destructor
 Node (Graph *, platform::Size node_id)
 Main constructor, no default constructor nor copy constructor.
virtual void copy_from (Node const *source)
 invoked during graph assignment operators to copy any node data from one graph to another graph. The source node must be the same type as this node.
void add_edge (Edge *edge_ptr, EdgeListIter &)
 adds edge pointer to edge list; returns an iterator to the new list element
void drop_edge (EdgeListIter edge_iterator)
 removes an edge iterator from the node's edge list. Only called by Edge class.
void drop_all_edges ()
 deletes all edges incident upon this node
void set_num_neighbors_counting_self_static (platform::Size neighbor)
Edge const * find_edge (platform::Size other_node_index) const
 a "slow" (linear) search for an edge.
Edgefind_edge (platform::Size other_node_index)
 non-const edge finding method; changes no data, but returns a non-const pointer
virtual void print () const
 send summaray data about this node to the screen
EdgeListIter edge_list_begin ()
 returns a non-const iterator to the beginning of its edge list
EdgeListConstIter const_edge_list_begin () const
 returns a const iterator to the beginning of its edge list
EdgeListIter edge_list_end ()
 returns a non-const iterator to the end of its edge list
EdgeListConstIter const_edge_list_end () const
 returns a const iterator to the end of its edge list
EdgeListIter lower_edge_list_begin ()
 returns a non-const iterator to the beginning of its lower-edge list
EdgeListConstIter const_lower_edge_list_begin () const
 returns a const iterator to the beginning of its lower-edge list
EdgeListIter lower_edge_list_end ()
 returns a non-const iterator to the end of its lower-edge list
EdgeListConstIter const_lower_edge_list_end () const
 returns a const iterator to the end of its lower-edge list
EdgeListIter upper_edge_list_begin ()
 returns a non-const iterator to the beginning of its upper-edge list
EdgeListConstIter const_upper_edge_list_begin () const
 returns a const iterator to the beginning of its upper-edge list
EdgeListIter upper_edge_list_end ()
 returns a non-const iterator to the end of its upper-edge list
EdgeListConstIter const_upper_edge_list_end () const
 returns a const iterator to the end of its upper-edge list
platform::Size get_node_index () const
 the index for this node
platform::Size num_edges () const
 the number of edges incident on this node, which may include a loop edge
platform::Size num_neighbors_counting_self () const
 the number of neighbors counting "self" as a neighbor.
platform::Size num_neighbors_counting_self_static () const
 the number of neighbors counting "self" as neighbor. Defaults to num_neighbors_counting_self() but can be set to other values as well. Useful in calculation of symmetrical structures.
platform::Size get_num_edges_to_smaller_indexed_nodes () const
 the number of lower neighbors
platform::Size get_num_edges_to_larger_indexed_nodes () const
 the number of upper neighbors -- which "self" neighborness is counted if a loop edge is present
virtual platform::Size count_static_memory () const
 memory accounting scheme
virtual platform::Size count_dynamic_memory () const
 memory accounting scheme
bool loop_incident () const
 NOTE TO SELF: remove loop support.

Protected Member Functions

Graphget_owner () const
 derived class access to the owner

Member Typedef Documentation


Constructor & Destructor Documentation

core::graph::Node::~Node ( ) [virtual]

virtual destructor

core::graph::Node::Node ( Graph owner,
platform::Size  node_id 
)

Main constructor, no default constructor nor copy constructor.


Member Function Documentation

void core::graph::Node::add_edge ( Edge edge_ptr,
EdgeListIter eiter 
)

adds edge pointer to edge list; returns an iterator to the new list element

If the other node this node is attached to by edge_ptr has a higher index then the edge is added to the end of its edge list; if the node has a smaller index, the edge pointer is added to the front of the edge list. The presence of a new edge means the edge vector is not up to date.

Parameters:
edge_ptr- [in] - the new edge

References core::graph::EdgeList::begin(), core::graph::EdgeList::end(), core::graph::Edge::get_other_ind(), core::graph::EdgeList::insert(), core::graph::Edge::is_loop(), and num_neighbors_counting_self().

EdgeListConstIter core::graph::Node::const_edge_list_begin ( ) const [inline]
EdgeListConstIter core::graph::Node::const_edge_list_end ( ) const [inline]
EdgeListConstIter core::graph::Node::const_lower_edge_list_begin ( ) const [inline]

returns a const iterator to the beginning of its lower-edge list

References core::graph::EdgeList::const_begin().

EdgeListConstIter core::graph::Node::const_lower_edge_list_end ( ) const [inline]

returns a const iterator to the end of its lower-edge list

EdgeListConstIter core::graph::Node::const_upper_edge_list_begin ( ) const [inline]
EdgeListConstIter core::graph::Node::const_upper_edge_list_end ( ) const [inline]
void core::graph::Node::copy_from ( Node const *  source) [virtual]

invoked during graph assignment operators to copy any node data from one graph to another graph. The source node must be the same type as this node.

copy-from for use in Graph::operator= and copy ctors; derived classes must define their own version of this function

Reimplemented in core::pack::interaction_graph::SimpleNode, core::scoring::constraints::ConstraintNode, core::scoring::EnergyNode, core::scoring::MinimizationNode, core::scoring::TenANeighborNode, and core::scoring::TwelveANeighborNode.

Referenced by core::scoring::constraints::ConstraintNode::copy_from().

platform::Size core::graph::Node::count_dynamic_memory ( ) const [virtual]
platform::Size core::graph::Node::count_static_memory ( ) const [virtual]

memory accounting scheme

called on most-derived class. The most-derived class should NOT recursively call this method on its parent class. The sizeof function will handle the whole Node (or DerivedNode).

Reimplemented in core::pack::interaction_graph::SimpleNode, core::scoring::constraints::ConstraintNode, core::scoring::EnergyNode, core::scoring::MinimizationNode, core::scoring::TenANeighborNode, and core::scoring::TwelveANeighborNode.

void core::graph::Node::drop_all_edges ( )

deletes all edges incident upon this node

As edges delete themselves, they invalidate any iterators that point to their (former) positions in the node and graph edge lists. Therefore, before calling delete on an edge object, one must grab the next iterator in a list. Below, nextiter copies iter and is incremented before iter's edge is deleted. Note also that "++iter" does not appear in the for loop.

References core::graph::EdgeList::begin(), core::graph::Graph::delete_edge(), and core::graph::EdgeList::end().

Referenced by core::graph::Graph::drop_all_edges_for_node().

void core::graph::Node::drop_edge ( EdgeListIter  eiter)

removes an edge iterator from the node's edge list. Only called by Edge class.

edges efficiently delete themselves from the edge lists of the nodes they are incident upon by keeping a pair of iterators. Edges request nodes delete them by handing the iterator back to the node.

Parameters:
edge- [in] - the iterator for this node's edge list that points at the edge which is trying to delete itself

References core::graph::EdgeList::erase(), and num_neighbors_counting_self().

Referenced by core::graph::Edge::~Edge().

EdgeListIter core::graph::Node::edge_list_begin ( ) [inline]
EdgeListIter core::graph::Node::edge_list_end ( ) [inline]
Edge const * core::graph::Node::find_edge ( platform::Size  other_node) const

a "slow" (linear) search for an edge.

Constant time if each vertex has a constant number of edges. Edges are identified by the index of the node to which the edge connects this node. Returns NULL when there is no such connecting edge.

Parameters:
other_node- [in] - the index of the node that the desired edge connects this node to
Edge * core::graph::Node::find_edge ( platform::Size  other_node_index)

non-const edge finding method; changes no data, but returns a non-const pointer

References core::graph::EdgeList::begin(), core::graph::EdgeList::end(), core::sequence::end, and get_node_index().

platform::Size core::graph::Node::get_node_index ( ) const [inline]

the index for this node

Referenced by find_edge(), core::scoring::TenANeighborNode::neighbor_mass(), and print().

platform::Size core::graph::Node::get_num_edges_to_larger_indexed_nodes ( ) const [inline]

the number of upper neighbors -- which "self" neighborness is counted if a loop edge is present

platform::Size core::graph::Node::get_num_edges_to_smaller_indexed_nodes ( ) const [inline]

the number of lower neighbors

Graph* core::graph::Node::get_owner ( ) const [inline, protected]

derived class access to the owner

bool core::graph::Node::loop_incident ( ) const [inline]

NOTE TO SELF: remove loop support.

EdgeListIter core::graph::Node::lower_edge_list_begin ( ) [inline]

returns a non-const iterator to the beginning of its lower-edge list

References core::graph::EdgeList::begin().

EdgeListIter core::graph::Node::lower_edge_list_end ( ) [inline]

returns a non-const iterator to the end of its lower-edge list

platform::Size core::graph::Node::num_edges ( ) const [inline]

the number of edges incident on this node, which may include a loop edge

platform::Size core::graph::Node::num_neighbors_counting_self ( ) const [inline]
platform::Size core::graph::Node::num_neighbors_counting_self_static ( ) const [inline]

the number of neighbors counting "self" as neighbor. Defaults to num_neighbors_counting_self() but can be set to other values as well. Useful in calculation of symmetrical structures.

Referenced by core::scoring::hbonds::fill_hbond_set().

void core::graph::Node::print ( ) const [virtual]

send summaray data about this node to the screen

virtual function to print node to standard out

Reimplemented in core::pack::interaction_graph::SimpleNode.

References core::graph::EdgeList::const_begin(), core::graph::EdgeList::const_end(), and get_node_index().

Referenced by core::scoring::MinimizationNode::print(), and core::scoring::EnergyNode::print().

void core::graph::Node::set_num_neighbors_counting_self_static ( platform::Size  neighbor)

manually change the number of neighbors for a Node. Used for symmetry scoring

EdgeListIter core::graph::Node::upper_edge_list_begin ( ) [inline]

returns a non-const iterator to the beginning of its upper-edge list

Referenced by core::pack::interaction_graph::SimpleInteractionGraph::total_energy().

EdgeListIter core::graph::Node::upper_edge_list_end ( ) [inline]

returns a non-const iterator to the end of its upper-edge list

References core::graph::EdgeList::end().

Referenced by core::pack::interaction_graph::SimpleInteractionGraph::total_energy().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines