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

#include <Graph.hh>

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

List of all members.

Public Types

typedef EdgeListIterator EdgeListIter

Public Member Functions

virtual ~Edge ()
 destructor
 Edge (Graph *owner, platform::Size first_node_ind, platform::Size 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, and this method absolutely must be implemented by derived Graph classes.
virtual void copy_from (Edge const *source)
 copy-from for use in Graph::operator= and copy ctors
platform::Size get_other_ind (platform::Size node_index) 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.
Node const * get_other_node (platform::Size node_index) 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.
Nodeget_other_node (platform::Size node_index)
 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.
platform::Size get_first_node_ind () const
 returns the index of the lower node
platform::Size get_second_node_ind () const
 returns the index of the upper node
void set_pos_in_owners_list (EdgeListIter edge_iterator)
 called only by class Graph, this function gives the Edge the data it needs to later delete itself from its owner's edge list in constant time.
bool same_edge (platform::Size node1, platform::Size 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.
bool is_loop () const
 Is this edge a loop? In Pseudographs, loop edges are incident twice on a single vertex.
virtual platform::Size count_static_memory () const
 how much memory is statically allocated by this edge
virtual platform::Size count_dynamic_memory () const
 how much memory is dynamically allocated by this edge -- must be recursively invoked by a derived class.

Protected Member Functions

platform::Size get_node_index (platform::Size index) const
 get the node index for one of the two nodes this edge is incident upon uses c-style index-from-0.
Node const * get_node (platform::Size index) const
 get a const * to one node that this edge is incident upon uses c-style index-from-0 for these two nodes
Nodeget_node (platform::Size index)
 get a non-const * to one node that this edge is incident upon uses c-style index-from-0 for these two nodes
Graph const * get_owner () const
 get a const * to the owning graph
Graphget_owner ()
 get a non-const * to the owning graph

Member Typedef Documentation


Constructor & Destructor Documentation

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

destructor

removes all record of this edge from edge-lists of the 1) nodes this edge is incident upon and 2) the owning interaction graph

References core::graph::Graph::drop_edge(), core::graph::Node::drop_edge(), and is_loop().

core::graph::Edge::Edge ( Graph owner,
platform::Size  first_node_ind,
platform::Size  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, and this method absolutely must be implemented by derived Graph classes.

main constructor for edge, no default nor copy constructors

edge adds itself to the edge list of the two nodes its set to be incident upon, and stores the list-iterators that the nodes return.

Parameters:
owner- [in] - owning InteractionGraph
first_node_ind- [in] - the index of the first node
second_node_ind- [in] - the index of the second node

Member Function Documentation

void core::graph::Edge::copy_from ( Edge const *  source) [virtual]

copy-from for use in Graph::operator= and copy ctors

derived classes should recursively call the copy_from method to ensure all parent class data is copied. It just so happens that this method does nothing, but that could change and the derived class should include a call to this function for that reason.

Reimplemented in core::pack::interaction_graph::SimpleEdge, core::scoring::constraints::ConstraintEdge, core::scoring::EnergyEdge, core::scoring::MinimizationEdge, core::scoring::TenANeighborEdge, and core::scoring::TwelveANeighborEdge.

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

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

how much memory is statically allocated by this edge

memory accouting scheme

This is called non-recursively on the most-derived class

Reimplemented in core::pack::interaction_graph::SimpleEdge, core::scoring::constraints::ConstraintEdge, core::scoring::EnergyEdge, core::scoring::MinimizationEdge, core::scoring::TenANeighborEdge, and core::scoring::TwelveANeighborEdge.

platform::Size core::graph::Edge::get_first_node_ind ( ) const [inline]
Node const* core::graph::Edge::get_node ( platform::Size  index) const [inline, protected]

get a const * to one node that this edge is incident upon uses c-style index-from-0 for these two nodes

Referenced by core::pack::interaction_graph::SimpleEdge::compute_energy(), core::scoring::MinimizationEdge::get_minimization_node(), and core::pack::interaction_graph::SimpleEdge::update_proposed_energy().

Node* core::graph::Edge::get_node ( platform::Size  index) [inline, protected]

get a non-const * to one node that this edge is incident upon uses c-style index-from-0 for these two nodes

platform::Size core::graph::Edge::get_node_index ( platform::Size  index) const [inline, protected]

get the node index for one of the two nodes this edge is incident upon uses c-style index-from-0.

platform::Size core::graph::Edge::get_other_ind ( platform::Size  node_index) 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.

returns the index of the other node that the edge is incident upon

Referenced by core::graph::Node::add_edge().

Node * core::graph::Edge::get_other_node ( platform::Size  node_index)

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.

returns a pointer to the other node that the edge is incident upon

Node const * core::graph::Edge::get_other_node ( platform::Size  node_index) 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.

return a const pointer to the other node that the edge is incident upon

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

get a non-const * to the owning graph

Graph const* core::graph::Edge::get_owner ( ) const [inline, protected]
platform::Size core::graph::Edge::get_second_node_ind ( ) const [inline]
bool core::graph::Edge::is_loop ( ) const [inline]

Is this edge a loop? In Pseudographs, loop edges are incident twice on a single vertex.

Referenced by core::graph::Node::add_edge(), and ~Edge().

bool core::graph::Edge::same_edge ( platform::Size  node1,
platform::Size  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.

returns true if this edge connects nodes of index node1 and node2 the order of node1 and node2 is not important

Parameters:
node1- [in] - index of one of the two nodes
node2- [in] - index of the other of the two nodes

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

void core::graph::Edge::set_pos_in_owners_list ( EdgeListIter  edge_iterator)

called only by class Graph, this function gives the Edge the data it needs to later delete itself from its owner's edge list in constant time.

sets the iterator for this edge's position in its owner's edge list

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


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