Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
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]

Public Types

typedef EdgeListIterator EdgeListIter
 
typedef EdgeListConstIterator EdgeListConstIter
 

Public Member Functions

virtual ~Node ()
 virtual destructor More...
 
 Node (Graph *, platform::Size node_id)
 Main constructor, no default constructor nor copy constructor. More...
 
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. More...
 
void add_edge (Edge *edge_ptr, EdgeListIter &)
 adds edge pointer to edge list; returns an iterator to the new list element More...
 
void drop_edge (EdgeListIter edge_iterator)
 removes an edge iterator from the node's edge list. Only called by Edge class. More...
 
void drop_all_edges ()
 deletes all edges incident upon this node More...
 
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. More...
 
Edgefind_edge (platform::Size other_node_index)
 non-const edge finding method; changes no data, but returns a non-const pointer More...
 
virtual void print () const
 send summaray data about this node to the screen More...
 
EdgeListIter edge_list_begin ()
 returns a non-const iterator to the beginning of its edge list More...
 
EdgeListConstIter const_edge_list_begin () const
 returns a const iterator to the beginning of its edge list More...
 
EdgeListIter edge_list_end ()
 returns a non-const iterator to the end of its edge list More...
 
EdgeListConstIter const_edge_list_end () const
 returns a const iterator to the end of its edge list More...
 
EdgeListIter lower_edge_list_begin ()
 returns a non-const iterator to the beginning of its lower-edge list More...
 
EdgeListConstIter const_lower_edge_list_begin () const
 returns a const iterator to the beginning of its lower-edge list More...
 
EdgeListIter lower_edge_list_end ()
 returns a non-const iterator to the end of its lower-edge list More...
 
EdgeListConstIter const_lower_edge_list_end () const
 returns a const iterator to the end of its lower-edge list More...
 
EdgeListIter upper_edge_list_begin ()
 returns a non-const iterator to the beginning of its upper-edge list More...
 
EdgeListConstIter const_upper_edge_list_begin () const
 returns a const iterator to the beginning of its upper-edge list More...
 
EdgeListIter upper_edge_list_end ()
 returns a non-const iterator to the end of its upper-edge list More...
 
EdgeListConstIter const_upper_edge_list_end () const
 returns a const iterator to the end of its upper-edge list More...
 
platform::Size 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 num_neighbors_counting_self () const
 the number of neighbors counting "self" as a neighbor. More...
 
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. More...
 
platform::Size get_num_edges_to_smaller_indexed_nodes () const
 the number of lower neighbors More...
 
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 More...
 
virtual platform::Size count_static_memory () const
 memory accounting scheme More...
 
virtual platform::Size count_dynamic_memory () const
 memory accounting scheme More...
 
bool loop_incident () const
 NOTE TO SELF: remove loop support. More...
 

Protected Member Functions

Graphget_owner () const
 derived class access to the owner More...
 

Private Member Functions

 Node ()
 
 Node (Node const &)
 
Nodeoperator= (Node &)
 

Private Attributes

platform::Size node_index_
 
platform::Size num_incident_edges_
 
platform::Size num_neighbors_counting_self_static_
 
bool loop_incident_
 
platform::Size num_edges_to_smaller_indexed_nodes_
 NOTE TO SELF: remove loop support. More...
 
platform::Size num_edges_to_larger_indexed_nodes_
 
EdgeList incident_edge_list_
 
EdgeListIter first_upper_edge_
 
Graphowner_
 

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.

core::graph::Node::Node ( )
private

Referenced by count_static_memory().

core::graph::Node::Node ( Node const &  )
private

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(), first_upper_edge_, core::graph::Edge::get_other_ind(), incident_edge_list_, core::graph::EdgeList::insert(), core::graph::Edge::is_loop(), loop_incident_, node_index_, num_edges_to_larger_indexed_nodes_, num_edges_to_smaller_indexed_nodes_, num_incident_edges_, num_neighbors_counting_self(), and num_neighbors_counting_self_static_.

EdgeListConstIter core::graph::Node::const_edge_list_begin ( ) const
inline
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(), and incident_edge_list_.

Referenced by core::scoring::geometric_solvation::add_to_individual_sol_energies(), protocols::pmut_scan::PointMutScanDriver::calculate_neighbor_table(), protocols::enzdes::PackRotamersMoverPartGreedy::choose_n_best(), core::pack::compare_mingraph_and_energy_graph(), core::pack::compare_simple_inteaction_graph_alt_state_and_energy_graph(), protocols::simple_filters::ResidueIEFilter::compute(), protocols::fldsgn::filters::InterlockingAromaFilter::compute(), core::scoring::geometric_solvation::ExactOccludedHbondSolEnergy::compute_polar_group_sol_energy(), core::scoring::methods::Fa_MbsolvEnergy::eval_atom_derivative(), core::scoring::rna::RNA_LJ_BaseEnergy::eval_atom_derivative(), core::scoring::hackaro::HackAroEnergy::eval_atom_derivative(), core::scoring::methods::EnvSmoothEnergy::eval_atom_derivative(), core::scoring::methods::MembraneEnvSmoothEnergy::eval_atom_derivative(), core::scoring::methods::LK_CosThetaEnergy::eval_atom_derivative(), core::scoring::rna::RNA_FullAtomStackingEnergy::eval_atom_derivative(), core::scoring::methods::HybridVDW_Energy::eval_atom_derivative(), core::scoring::methods::VDW_Energy::eval_atom_derivative(), core::scoring::rna::RNA_DataBackboneEnergy::eval_atom_derivative(), core::scoring::rna::RNA_VDW_Energy::eval_atom_derivative(), core::scoring::geometric_solvation::ContextIndependentGeometricSolEnergy::eval_atom_derivative(), core::scoring::geometric_solvation::GeometricSolEnergy::eval_atom_derivative(), core::scoring::hackelec::HackElecEnergyAroAll::eval_atom_derivative(), core::scoring::hackelec::HackElecEnergyAroAro::eval_atom_derivative(), core::scoring::hackelec::RNAHackElecEnergy::eval_atom_derivative(), core::scoring::rna::RNA_LowResolutionPotential::eval_atom_derivative_base_base(), core::scoring::rna::RNA_LowResolutionPotential::eval_atom_derivative_rna_backbone_backbone(), core::scoring::rna::RNA_LowResolutionPotential::eval_atom_derivative_rna_base_backbone(), core::scoring::rna::RNA_LowResolutionPotential::eval_atom_derivative_rna_repulsive(), core::scoring::geometric_solvation::ContextIndependentGeometricSolEnergy::eval_atom_energy(), core::scoring::geometric_solvation::GeometricSolEnergy::eval_atom_energy(), protocols::hotspot_hashing::HotspotStubSet::evaluate_stub_bumps_(), protocols::hotspot_hashing::HotspotStubSet::evaluate_stub_self_energy_(), protocols::enzdes::EnzdesFlexibleRegion::extract_lig_designability_score(), protocols::swa::protein::StepWiseProteinPacker::figure_out_neighbors(), protocols::swa::protein::StepWiseProteinResidueSampler::figure_out_neighbors(), core::graph::find_connected_components(), protocols::enzdes::EnzdesFlexibleRegion::get_12A_neighbors(), protocols::ligand_docking::LigandBaseProtocol::get_non_bb_clashing_rotamers(), protocols::swa::monte_carlo::RNA_O2StarMover::get_random_o2star_residue_near_moving_residue(), core::scoring::SecondaryStructurePotential::hspair(), protocols::simple_filters::RotamerBoltzmannWeight::interface_interaction_energy(), protocols::swa::protein::StepWiseProteinPoseMinimizer::let_neighboring_chis_minimize(), core::scoring::electron_density::ElectronDensity::matchRes(), core::scoring::TenANeighborNode::neighbor_mass(), core::pack::scmin::CartSCMinMultifunc::operator()(), core::pack::scmin::SCMinMultifunc::operator()(), core::pack::interaction_graph::LinearMemNode::project_deltaE_for_substitution(), protocols::toolbox::pose_metric_calculators::NeighborhoodByDistanceCalculator::recompute(), protocols::toolbox::pose_metric_calculators::InterGroupNeighborsCalculator::recompute(), protocols::features::AtomInResidueAtomInResiduePairFeatures::report_atom_pairs(), protocols::features::ProteinBackboneAtomAtomPairFeatures::report_features(), core::scoring::geometric_solvation::OccludedHbondSolEnergy_onebody::residue_energy(), core::scoring::geometric_solvation::ExactOccludedHbondSolEnergy::residue_energy(), core::pack::RTMin::rtmin(), protocols::fldsgn::potentials::sspot::HSPairPotential::score(), core::scoring::methods::EnvSmoothEnergy::setup_for_derivatives(), core::scoring::methods::MembraneEnvSmoothEnergy::setup_for_derivatives(), core::scoring::hbonds::HBondSet::setup_for_residue_pair_energies(), core::scoring::FACTSPotential::setup_for_scoring(), core::optimization::symmetry::SymMinimizerMap::SymMinimizerMap(), core::scoring::TenANeighborNode::update_neighbor_mass_sum(), and core::scoring::rna::RNA_LowResolutionPotential::update_rna_base_base_interactions().

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(), and incident_edge_list_.

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

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

References first_upper_edge_.

EdgeListConstIter core::graph::Node::const_upper_edge_list_begin ( ) const
inline
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(), and incident_edge_list_.

Referenced by protocols::features::helixAssembly::HelixBundleFeatures::calc_fa_energy(), protocols::pack_daemon::PackDaemon::calculate_background_energies(), core::scoring::methods::LK_hack::calculate_derivatives_for_atoms_and_pseudo_base_atoms(), core::scoring::EnvPairPotential::compute_centroid_environment(), core::scoring::SmoothEnvPairPotential::compute_centroid_environment(), core::scoring::SmoothEnvPairPotential::compute_dcentroid_environment(), protocols::toolbox::pose_metric_calculators::NumberHBondsCalculator::compute_Hbonds_for_residue(), core::scoring::WaterAdductHBondPotential::fill_h2o_hbond_set(), core::scoring::hbonds::fill_hbond_set(), core::scoring::hbonds::fill_hbond_set_by_AHdist_threshold(), core::scoring::ScoreFunction::get_sub_score(), protocols::features::ResidueScoresFeatures::insert_two_body_residue_score_rows(), protocols::scoring::Interface::protein_calculate(), core::pose::metrics::simple_calculators::InterfaceDeltaEnergeticsCalculator::recompute(), protocols::toolbox::pose_metric_calculators::NonlocalContactsCalculator::recompute(), protocols::fldsgn::potentials::sspot::SSPairPotential::score(), protocols::fldsgn::potentials::sspot::NatbiasStrandPairPotential::score(), protocols::vip::set_local_movemap(), core::scoring::SecondaryStructurePotential::sspair(), and protocols::scoring::Interface::symmetric_protein_calculate().

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::scoring::MinimizationNode, core::scoring::EnergyNode, core::pack::interaction_graph::SimpleNode, core::scoring::TenANeighborNode, core::scoring::TwelveANeighborNode, and core::scoring::constraints::ConstraintNode.

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::scoring::MinimizationNode, core::scoring::EnergyNode, core::pack::interaction_graph::SimpleNode, core::scoring::TenANeighborNode, core::scoring::TwelveANeighborNode, and core::scoring::constraints::ConstraintNode.

References Node().

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(), core::graph::EdgeList::end(), incident_edge_list_, and owner_.

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(), first_upper_edge_, incident_edge_list_, loop_incident_, node_index_, num_edges_to_larger_indexed_nodes_, num_edges_to_smaller_indexed_nodes_, num_incident_edges_, num_neighbors_counting_self(), and num_neighbors_counting_self_static_.

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::sequence::end, core::graph::EdgeList::end(), first_upper_edge_, get_node_index(), incident_edge_list_, node_index_, and protocols::loops::start.

platform::Size core::graph::Node::get_node_index ( ) const
inline
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

References num_edges_to_larger_indexed_nodes_.

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

the number of lower neighbors

References num_edges_to_smaller_indexed_nodes_.

Graph* core::graph::Node::get_owner ( ) const
inlineprotected
bool core::graph::Node::loop_incident ( ) const
inline

NOTE TO SELF: remove loop support.

References loop_incident_.

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(), and incident_edge_list_.

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

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

References first_upper_edge_.

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

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

References num_incident_edges_.

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.

References num_neighbors_counting_self_static_.

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

Node& core::graph::Node::operator= ( Node )
private
void core::graph::Node::print ( ) const
virtual
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

References num_neighbors_counting_self_static_.

Referenced by core::scoring::symmetry::SymmetricEnergies::update_neighbor_links().

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

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

References first_upper_edge_.

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

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

Member Data Documentation

EdgeListIter core::graph::Node::first_upper_edge_
private
EdgeList core::graph::Node::incident_edge_list_
private
bool core::graph::Node::loop_incident_
private
platform::Size core::graph::Node::node_index_
private
platform::Size core::graph::Node::num_edges_to_larger_indexed_nodes_
private
platform::Size core::graph::Node::num_edges_to_smaller_indexed_nodes_
private

NOTE TO SELF: remove loop support.

Referenced by add_edge(), drop_edge(), and get_num_edges_to_smaller_indexed_nodes().

platform::Size core::graph::Node::num_incident_edges_
private
platform::Size core::graph::Node::num_neighbors_counting_self_static_
private
Graph* core::graph::Node::owner_
private

Referenced by drop_all_edges(), and get_owner().


The documentation for this class was generated from the following files: