Rosetta 3.4
|
#include <Graph.hh>
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. | |
Edge * | find_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 | |
Graph * | get_owner () const |
derived class access to the owner |
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.
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.
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] |
returns a const iterator to the beginning of its edge list
References core::graph::EdgeList::const_begin().
Referenced by core::scoring::geometric_solvation::ExactOccludedHbondSolEnergy::compute_polar_group_sol_energy(), protocols::enzdes::EnzdesFlexibleRegion::extract_lig_designability_score(), core::graph::find_connected_components(), protocols::enzdes::EnzdesFlexibleRegion::get_12A_neighbors(), protocols::simple_filters::RotamerBoltzmannWeight::interface_interaction_energy(), core::scoring::TenANeighborNode::neighbor_mass(), core::pack::interaction_graph::LinearMemNode::project_deltaE_for_substitution(), core::scoring::geometric_solvation::OccludedHbondSolEnergy_onebody::residue_energy(), core::scoring::geometric_solvation::ExactOccludedHbondSolEnergy::residue_energy(), and core::optimization::symmetry::SymMinimizerMap::SymMinimizerMap().
EdgeListConstIter core::graph::Node::const_edge_list_end | ( | ) | const [inline] |
returns a const iterator to the end of its edge list
References core::graph::EdgeList::const_end().
Referenced by core::scoring::geometric_solvation::ExactOccludedHbondSolEnergy::compute_polar_group_sol_energy(), protocols::enzdes::EnzdesFlexibleRegion::extract_lig_designability_score(), core::graph::find_connected_components(), protocols::enzdes::EnzdesFlexibleRegion::get_12A_neighbors(), protocols::simple_filters::RotamerBoltzmannWeight::interface_interaction_energy(), core::scoring::TenANeighborNode::neighbor_mass(), core::pack::interaction_graph::LinearMemNode::project_deltaE_for_substitution(), core::scoring::geometric_solvation::OccludedHbondSolEnergy_onebody::residue_energy(), core::scoring::geometric_solvation::ExactOccludedHbondSolEnergy::residue_energy(), and core::optimization::symmetry::SymMinimizerMap::SymMinimizerMap().
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] |
returns a const iterator to the beginning of its upper-edge list
Referenced by protocols::toolbox::pose_metric_calculators::NumberHBondsCalculator::compute_Hbonds_for_residue(), and protocols::toolbox::pose_metric_calculators::NonlocalContactsCalculator::recompute().
EdgeListConstIter core::graph::Node::const_upper_edge_list_end | ( | ) | const [inline] |
returns a const iterator to the end of its upper-edge list
References core::graph::EdgeList::const_end().
Referenced by protocols::toolbox::pose_metric_calculators::NumberHBondsCalculator::compute_Hbonds_for_residue(), and protocols::toolbox::pose_metric_calculators::NonlocalContactsCalculator::recompute().
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] |
memory accounting scheme
recursively descend through heirarchy accounting for heap memory usage. Each derived class in the heirarchy should recursively add the amount of dynamic memory its parent allocates by calling parent::count_dynamic_memory
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::TwelveANeighborNode::count_dynamic_memory(), core::scoring::TenANeighborNode::count_dynamic_memory(), core::scoring::MinimizationNode::count_dynamic_memory(), core::scoring::EnergyNode::count_dynamic_memory(), and core::scoring::constraints::ConstraintNode::count_dynamic_memory().
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.
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] |
returns a non-const iterator to the beginning of its edge list
References core::graph::EdgeList::begin().
Referenced by core::pack::interaction_graph::SimpleNode::commit_change_no_res_pointer_update(), core::pack::interaction_graph::SimpleInteractionGraph::consider_substitution(), core::pack::reinitialize_mingraph_neighborhood_for_residue(), core::pack::interaction_graph::SimpleNode::set_alternate(), core::pack::interaction_graph::SimpleNode::set_current(), and core::pack::interaction_graph::SimpleNode::update_energies_after_passive_change().
EdgeListIter core::graph::Node::edge_list_end | ( | ) | [inline] |
returns a non-const iterator to the end of its edge list
References core::graph::EdgeList::end().
Referenced by core::pack::interaction_graph::SimpleNode::commit_change_no_res_pointer_update(), core::pack::interaction_graph::SimpleInteractionGraph::consider_substitution(), core::pack::reinitialize_mingraph_neighborhood_for_residue(), core::pack::interaction_graph::SimpleNode::set_alternate(), core::pack::interaction_graph::SimpleNode::set_current(), and core::pack::interaction_graph::SimpleNode::update_energies_after_passive_change().
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.
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] |
the number of neighbors counting "self" as a neighbor.
Referenced by add_edge(), protocols::toolbox::rotamer_set_operations::RigidBodyMoveRSO::alter_rotamer_set(), core::pack::rotamer_set::RotamerSet_::build_rotamers_for_concrete(), protocols::toolbox::pose_metric_calculators::NumberHBondsCalculator::compute_Hbonds_for_residue(), core::pack::rotamer_set::RotamerSet_::compute_one_body_energy_maps(), core::pack::interaction_graph::SurfacePotential::compute_pose_surface_energy(), drop_edge(), core::scoring::hbonds::HBondEnergy::evaluate_rotamer_background_energies(), core::scoring::WaterAdductHBondPotential::fill_h2o_hbond_set(), core::pack::interaction_graph::SurfaceBackgroundNode< V, E, G >::initialize_num_neighbors_counting_self(), core::pack::interaction_graph::SurfaceNode< V, E, G >::initialize_num_neighbors_counting_self(), protocols::match::NumNeighborsMPM::modified_match_positions(), and core::io::sequence_comparation::DesignContrast::setNeighbors().
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().