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::Edge Class Reference

#include <Graph.hh>

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

Public Types

typedef EdgeListIterator EdgeListIter
 

Public Member Functions

virtual ~Edge ()
 destructor More...
 
 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. More...
 
virtual void copy_from (Edge const *source)
 copy-from for use in Graph::operator= and copy ctors More...
 
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. More...
 
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. More...
 
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. More...
 
platform::Size get_first_node_ind () const
 returns the index of the lower node More...
 
platform::Size get_second_node_ind () const
 returns the index of the upper node More...
 
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. More...
 
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. More...
 
bool is_loop () const
 Is this edge a loop? In Pseudographs, loop edges are incident twice on a single vertex. More...
 
virtual platform::Size count_static_memory () const
 how much memory is statically allocated by this edge More...
 
virtual platform::Size count_dynamic_memory () const
 how much memory is dynamically allocated by this edge – must be recursively invoked by a derived class. More...
 

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. More...
 
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 More...
 
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 More...
 
Graph const * get_owner () const
 get a const * to the owning graph More...
 
Graphget_owner ()
 get a non-const * to the owning graph More...
 

Private Member Functions

 Edge ()
 
 Edge (Edge const &)
 
Edgeoperator= (Edge &)
 

Private Attributes

platform::Size node_indices_ [2]
 
Nodenodes_ [2]
 
EdgeListIter pos_in_nodes_edge_list_ [2]
 
EdgeListIter pos_in_owners_edge_list_
 
Graphowner_
 

Detailed Description

Definition at line 555 of file Graph.hh.

Member Typedef Documentation

Definition at line 558 of file Graph.hh.

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

Definition at line 396 of file Graph.cc.

References core::graph::Node::drop_edge(), core::graph::Graph::drop_edge(), is_loop(), nodes_, owner_, pos_in_nodes_edge_list_, and pos_in_owners_edge_list_.

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

Definition at line 415 of file Graph.cc.

References core::graph::Graph::nodes_.

core::graph::Edge::Edge ( )
private

Referenced by count_static_memory().

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

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::scoring::MinimizationEdge, core::pack::interaction_graph::SimpleEdge, core::scoring::TenANeighborEdge, core::scoring::EnergyEdge, core::scoring::TwelveANeighborEdge, and core::scoring::constraints::ConstraintEdge.

Definition at line 438 of file Graph.cc.

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

platform::Size core::graph::Edge::count_dynamic_memory ( ) const
virtual

how much memory is dynamically allocated by this edge – must be recursively invoked by a derived class.

memory accounting scheme

This method should be called recursively by derived classes – that is, each class should recurse to its parent.

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

Definition at line 496 of file Graph.cc.

Referenced by core::scoring::constraints::ConstraintEdge::count_dynamic_memory(), core::scoring::TwelveANeighborEdge::count_dynamic_memory(), core::scoring::TenANeighborEdge::count_dynamic_memory(), core::scoring::EnergyEdge::count_dynamic_memory(), and core::scoring::MinimizationEdge::count_dynamic_memory().

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::scoring::MinimizationEdge, core::pack::interaction_graph::SimpleEdge, core::scoring::EnergyEdge, core::scoring::TenANeighborEdge, core::scoring::TwelveANeighborEdge, and core::scoring::constraints::ConstraintEdge.

Definition at line 487 of file Graph.cc.

References Edge().

platform::Size core::graph::Edge::get_first_node_ind ( ) const
inline
Node const* core::graph::Edge::get_node ( platform::Size  index) const
inlineprotected

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

Definition at line 625 of file Graph.hh.

References nodes_.

Referenced by core::scoring::geometric_solvation::add_to_individual_sol_energies(), protocols::pack_daemon::PackDaemon::calculate_background_energies(), core::scoring::methods::LK_hack::calculate_derivatives_for_atoms_and_pseudo_base_atoms(), protocols::pmut_scan::PointMutScanDriver::calculate_neighbor_table(), core::scoring::rna::RNA_PairwiseLowResolutionEnergy::clean_up_rna_two_body_energy_tables(), core::pack::compare_mingraph_and_energy_graph(), core::pack::compare_simple_inteaction_graph_alt_state_and_energy_graph(), protocols::simple_filters::ResidueIEFilter::compute(), protocols::simple_filters::ResidueSetChainEnergyFilter::compute(), protocols::fldsgn::filters::InterlockingAromaFilter::compute(), core::scoring::EnvPairPotential::compute_centroid_environment(), core::scoring::SmoothEnvPairPotential::compute_centroid_environment(), core::scoring::SmoothEnvPairPotential::compute_dcentroid_environment(), core::pack::interaction_graph::SimpleEdge::compute_energy(), protocols::flexpack::interaction_graph::OTFFlexbbInteractionGraph::debug_note_projected_deltaE_of_considered_substitution(), core::scoring::methods::Fa_MbsolvEnergy::eval_atom_derivative(), core::scoring::rna::RNA_LJ_BaseEnergy::eval_atom_derivative(), core::scoring::methods::EnvSmoothEnergy::eval_atom_derivative(), core::scoring::hackaro::HackAroEnergy::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(), core::scoring::symmetry::SymmetricScoreFunction::eval_twobody_neighbor_energies(), core::scoring::ScoreFunction::eval_twobody_neighbor_energies(), protocols::swa::protein::StepWiseProteinPacker::figure_out_neighbors(), protocols::swa::protein::StepWiseProteinResidueSampler::figure_out_neighbors(), core::scoring::WaterAdductHBondPotential::fill_h2o_hbond_set(), core::scoring::hbonds::fill_hbond_set(), core::scoring::hbonds::fill_hbond_set_by_AHdist_threshold(), core::scoring::MinimizationEdge::get_minimization_node(), protocols::ligand_docking::LigandBaseProtocol::get_non_bb_clashing_rotamers(), protocols::swa::monte_carlo::RNA_O2StarMover::get_random_o2star_residue_near_moving_residue(), core::scoring::ScoreFunction::get_sub_score(), core::scoring::TenANeighborEdge::get_TenANode(), core::scoring::SecondaryStructurePotential::hspair(), protocols::features::ResidueScoresFeatures::insert_two_body_residue_score_rows(), protocols::swa::protein::StepWiseProteinPoseMinimizer::let_neighboring_chis_minimize(), core::scoring::electron_density::ElectronDensity::matchRes(), protocols::scoring::Interface::protein_calculate(), core::pose::metrics::simple_calculators::InterfaceDeltaEnergeticsCalculator::recompute(), 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::pack::RTMin::rtmin(), protocols::fldsgn::potentials::sspot::HSPairPotential::score(), protocols::fldsgn::potentials::sspot::SSPairPotential::score(), protocols::fldsgn::potentials::sspot::NatbiasStrandPairPotential::score(), protocols::vip::set_local_movemap(), 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::scoring::SecondaryStructurePotential::sspair(), core::pack::interaction_graph::SimpleEdge::update_proposed_energy(), and core::scoring::rna::RNA_LowResolutionPotential::update_rna_base_base_interactions().

Node* core::graph::Edge::get_node ( platform::Size  index)
inlineprotected

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

Definition at line 635 of file Graph.hh.

References nodes_.

platform::Size core::graph::Edge::get_node_index ( platform::Size  index) const
inlineprotected

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

Definition at line 615 of file Graph.hh.

References node_indices_.

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

Definition at line 441 of file Graph.cc.

References node_indices_.

Referenced by core::graph::Node::add_edge(), and protocols::simple_filters::ResidueIEFilter::compute().

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

Definition at line 455 of file Graph.cc.

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

Definition at line 448 of file Graph.cc.

References node_indices_, and nodes_.

Graph const* core::graph::Edge::get_owner ( ) const
inlineprotected
Graph* core::graph::Edge::get_owner ( )
inlineprotected

get a non-const * to the owning graph

Definition at line 653 of file Graph.hh.

References owner_.

platform::Size core::graph::Edge::get_second_node_ind ( ) const
inline

returns the index of the upper node

Definition at line 589 of file Graph.hh.

References node_indices_.

Referenced by core::scoring::Energies::accumulate_residue_total_energies(), core::scoring::Energies::accumulate_residue_total_energy(), core::graph::Graph::add_edge(), core::optimization::symmetry::atom_tree_get_atompairE_deriv(), core::optimization::atom_tree_get_atompairE_deriv(), protocols::pack_daemon::PackDaemon::calculate_background_energies(), core::optimization::cartesian_collect_atompairE_deriv(), protocols::simple_filters::ResidueSetChainEnergyFilter::compute(), core::scoring::EnvPairPotential::compute_centroid_environment(), core::scoring::SmoothEnvPairPotential::compute_centroid_environment(), core::scoring::SmoothEnvPairPotential::compute_dcentroid_environment(), core::scoring::TwelveANeighborGraph::create_new_edge(), core::scoring::TenANeighborGraph::create_new_edge(), core::graph::Graph::create_new_edge(), core::scoring::symmetry::SymmetricScoreFunction::eval_twobody_neighbor_energies(), core::scoring::ScoreFunction::eval_twobody_neighbor_energies(), core::scoring::ScoreFunction::get_sub_score(), protocols::features::ResidueScoresFeatures::insert_two_body_residue_score_rows(), core::scoring::electron_density::ElectronDensity::matchRes(), protocols::scoring::Interface::protein_calculate(), core::pose::metrics::simple_calculators::InterfaceDeltaEnergeticsCalculator::recompute(), protocols::toolbox::pose_metric_calculators::DecomposeAndReweightEnergiesCalculator::recompute(), core::scoring::symmetry::SymmetricScoreFunction::setup_for_derivatives(), core::scoring::ScoreFunction::setup_for_derivatives(), core::scoring::ScoreFunction::setup_for_scoring(), and protocols::scoring::Interface::symmetric_protein_calculate().

bool core::graph::Edge::is_loop ( ) const
inline

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

Definition at line 600 of file Graph.hh.

References node_indices_.

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

Edge& core::graph::Edge::operator= ( Edge )
private
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

Definition at line 474 of file Graph.cc.

References node_indices_.

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

Definition at line 461 of file Graph.cc.

References pos_in_owners_edge_list_.

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

Member Data Documentation

platform::Size core::graph::Edge::node_indices_[2]
private
Node* core::graph::Edge::nodes_[2]
private

Definition at line 660 of file Graph.hh.

Referenced by get_node(), get_other_node(), and ~Edge().

Graph* core::graph::Edge::owner_
private

Definition at line 665 of file Graph.hh.

Referenced by get_owner(), and ~Edge().

EdgeListIter core::graph::Edge::pos_in_nodes_edge_list_[2]
private

Definition at line 662 of file Graph.hh.

Referenced by ~Edge().

EdgeListIter core::graph::Edge::pos_in_owners_edge_list_
private

Definition at line 664 of file Graph.hh.

Referenced by set_pos_in_owners_list(), and ~Edge().


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