|
Rosetta 3.5
|
A Graph with constant time edge insertion and deletion. Extensible. More...
#include <Graph.hh>


Public Types | |
| typedef utility::vector1< Node * > | NodeVector |
| typedef Node::EdgeListIter | EdgeListIter |
| typedef Node::EdgeListConstIter | EdgeListConstIter |
| typedef utility::pointer::ReferenceCount | parent |
Public Member Functions | |
| virtual | ~Graph () |
| virtual destructor. Derived classes must ensure they've destroyed all their nodes and edges through a call to "destroy_everything" before this function is arrived at More... | |
| Graph () | |
| ctor More... | |
| Graph (platform::Size num_nodes) | |
| num nodes ctor More... | |
| Graph (Graph const &source) | |
| copy ctor. Must not be called by derived class copy ctors. More... | |
| Graph & | operator= (Graph const &source) |
| assignment operator. source and this must have the same type. More... | |
| void | copy_connectivity (Graph const &source) |
| copy the edge connectivity from a source graph with a potentially unknown type. More... | |
| platform::Size | num_nodes () const |
| the number of nodes in the graph More... | |
| void | set_num_nodes (platform::Size num_nodes) |
| set the number of nodes in the graph – deletes any existing edges in the graph More... | |
| Edge * | add_edge (platform::Size node1, platform::Size node2) |
| add an edge between two vertices. Invokes "create_edge" from the derived class. Returns a pointer to the edge after its been added, allowing the calling function to immediately set data for this edge. More... | |
| Edge * | add_edge (Edge const *example_edge) |
| add an edge to this graph copying the data from an edge in another graph. Returns a pointer to the edge after its been added, allowing the calling function to immediately set data for this edge. More... | |
| bool | get_edge_exists (platform::Size node1, platform::Size node2) const |
| is an edge already present in the graph? O(V) worst case. O(1) iff all vertices have O(1) edges More... | |
| void | drop_all_edges () |
| delete all the edges present in the graph More... | |
| void | drop_all_edges_for_node (platform::Size node) |
| delete all the edges for a single vertex in the graph More... | |
| void | print_vertices () const |
| send summary information to the screen for all vertices in the graph More... | |
| void | output_connectivity (std::ostream &os) const |
| send an edge list to the stream os. More... | |
| void | output_dimacs (std::ostream &os) const |
| describe this graph in dimacs form to the stream os. More... | |
| ObjexxFCL::FArray2D_int | all_pairs_shortest_paths () const |
| O(V^3). Computes all pairs shortest paths using Warshall's algorithm and writes all the path distances to the two-dimensional table. More... | |
| Node const * | get_node (platform::Size index) const |
| Node * | get_node (platform::Size index) |
| platform::Size | num_edges () const |
| EdgeListConstIter | const_edge_list_begin () const |
| returns a const iterator to the beginning of the (unordered) edge list for the graph. this edge list contains all the edges in the graph, not simply those for a particular vertex More... | |
| EdgeListIter | edge_list_begin () |
| returns a non-const iterator to the beginning of the (unordered) edge list for the graph. this edge list contains all the edges in the graph, not simply those for a particular vertex More... | |
| EdgeListConstIter | const_edge_list_end () const |
| returns a const iterator to the end of the (unordered) edge list for the graph. this edge list contains all the edges in the graph, not simply those for a particular vertex More... | |
| EdgeListIter | edge_list_end () |
| returns a non-const iterator to the end of the (unordered) edge list for the graph. this edge list contains all the edges in the graph, not simply those for a particular vertex More... | |
| Edge * | find_edge (platform::Size node1, platform::Size node2) |
| returns a pointer to the edge connecting nodes node1 and node2, if that edge exists in the graph, o.w. returns 0. Focuses the graph on this edge for fast subsequent retrieval. More... | |
| Edge const * | find_edge (platform::Size node1, platform::Size node2) const |
| returns a const pointer to the edge connecting nodes node1 and node2, if that edge exists in the graph, o.w. returns 0. Focuses the graph on this edge for fast subsequent retrieval. More... | |
| Edge * | focused_edge () |
| returns a pointer to the focused edge More... | |
| Edge const * | focused_edge () const |
| returns a const-pointer to the focused edge More... | |
| virtual void | delete_edge (Edge *edge) |
| remove an edge from the graph. (NEW AS OF 12/9/07) Never call C++'s "delete" function on an edge pointer directly. Derived classes must implement this function. If they wish to use unordered_object_pools to manage their memory More... | |
| platform::Size | getTotalMemoryUsage () const |
| returns a count of all the memory used by every vertex and edge in a graph by invoking the polymorphic count_static_memory and count_dynamic_memory of each (possibly derived) node and edge object as well as for the (possibly derived) graph class. More... | |
Protected Member Functions | |
| virtual platform::Size | count_static_memory () const |
| virtual platform::Size | count_dynamic_memory () const |
| void | drop_edge (EdgeListIter edge_iter) |
| remove an edge from the entire-graph edge list. Called only by class Edge during its destructor More... | |
| void | delete_everything () |
| deallocate all nodes and edges from the graph More... | |
| virtual Node * | create_new_node (platform::Size node_index) |
| factory method for node creation, defined by derived graph classes, called by the base class More... | |
| virtual Edge * | create_new_edge (platform::Size index1, platform::Size index2) |
| factory method for edge creation, defined by derived graph classes, called by the base class More... | |
| virtual Edge * | create_new_edge (Edge const *example_edge) |
| factory method for edge copy-construction. Derived class should downcast the example_edge pointer and may read that edge's data. More... | |
| boost::unordered_object_pool < EdgeListElement > & | edge_list_element_pool () |
| Used by class Node only, this is the pool from which edge lists are to allocate their edge lists elements from. More... | |
Private Attributes | |
| platform::Size | num_nodes_ |
| NodeVector | nodes_ |
| platform::Size | num_edges_ |
| boost::unordered_object_pool < EdgeListElement > * | edge_list_element_pool_ |
| the pool from which edge lists are to allocate their edge list elements More... | |
| EdgeList | edge_list_ |
| boost::unordered_object_pool < Edge > * | edge_pool_ |
| the pool from which class Graph allocates Edge objects. Not used by derived classes More... | |
| Edge * | focused_edge_ |
| Quick-access to a frequently needed edge – the most recently sought edge in a call to find_edge() or the most recently added edge. More... | |
Friends | |
| class | Node |
| class | Edge |
| typedef utility::vector1< Node* > core::graph::Graph::NodeVector |
|
virtual |
virtual destructor. Derived classes must ensure they've destroyed all their nodes and edges through a call to "destroy_everything" before this function is arrived at
destructor
Definition at line 508 of file Graph.cc.
References delete_everything(), edge_list_element_pool_, and edge_pool_.
| core::graph::Graph::Graph | ( | ) |
ctor
default constructor; creates an empty graph (no nodes, no edges)
Definition at line 516 of file Graph.cc.
Referenced by count_static_memory().
| core::graph::Graph::Graph | ( | platform::Size | num_nodes) |
num nodes ctor
Do not call this constructor from a derived class in the initialization list, since this constructor calls the polymorphic function create_new_node, and polymorphism does not work during constructors or destructors.
| num_ig_nodes | - [in] - number of nodes that this graph will contain |
Definition at line 532 of file Graph.cc.
References create_new_node(), nodes_, and num_nodes().
| core::graph::Graph::Graph | ( | Graph const & | source) |
copy ctor. Must not be called by derived class copy ctors.
copy constructor relies on factory methods and virtual "copy_from" methods
This copy constructor should NOT be used by derived classes. At the time this is called, the identity of this has not yet been resolved – this constructor will produce Node and Edge objects when it calls "create_new_node" and not DerivedNode or DerivedEdge objects. Derived class copy constructors should call the base class assignment operator once the initial construction has been completed.
Definition at line 555 of file Graph.cc.
References add_edge(), const_edge_list_begin(), const_edge_list_end(), core::graph::Edge::copy_from(), create_new_node(), find_edge(), nodes_, and num_nodes_.
| Edge * core::graph::Graph::add_edge | ( | platform::Size | index1, |
| platform::Size | index2 | ||
| ) |
add an edge between two vertices. Invokes "create_edge" from the derived class. Returns a pointer to the edge after its been added, allowing the calling function to immediately set data for this edge.
creates a new edge between nodes index1 and index2. Nodes do not have to be listed in order. For speed, does NOT check to see if edge already exists – except in debug mode.
uses factory method create_new_edge and adds the created edge to the graph's edge list. Not threadsafe. Only a single thread should add edges to the graph at a time.
| index1 | - [in] - index of one of the two nodes the edge is to connect |
| index2 | - [in] - index of the second of the two nodes the edge is to connect |
Definition at line 635 of file Graph.cc.
References create_new_edge(), edge_list_, focused_edge_, get_edge_exists(), core::graph::EdgeList::last(), num_edges_, core::graph::EdgeList::push_back(), and core::graph::Edge::set_pos_in_owners_list().
Referenced by core::scoring::EnergyGraph::add_energy_edge(), protocols::pmut_scan::PointMutScanDriver::calculate_neighbor_table(), core::scoring::TwelveANeighborGraph::conditionally_add_edge(), core::scoring::TenANeighborGraph::conditionally_add_edge(), copy_connectivity(), Graph(), core::pack::interaction_graph::SimpleInteractionGraph::initialize(), operator=(), and core::scoring::ScoreFunction::setup_for_lr2benmeth_minimization_for_respair().
add an edge to this graph copying the data from an edge in another graph. Returns a pointer to the edge after its been added, allowing the calling function to immediately set data for this edge.
for use in Graph operator=
Uses the edge copy constructor so that data stored on edges of one graph may be placed rapidly into the new edge of this graph.
Definition at line 658 of file Graph.cc.
References core::graph::EdgeList::begin(), create_new_edge(), edge_list_, focused_edge_, get_edge_exists(), core::graph::Edge::get_first_node_ind(), core::graph::Edge::get_second_node_ind(), num_edges_, core::graph::EdgeList::push_front(), and core::graph::Edge::set_pos_in_owners_list().
| FArray2D_int core::graph::Graph::all_pairs_shortest_paths | ( | ) | const |
O(V^3). Computes all pairs shortest paths using Warshall's algorithm and writes all the path distances to the two-dimensional table.
compute all node distances and return FArray2D with that information
O(n^3)
Definition at line 762 of file Graph.cc.
References core::graph::EdgeList::begin(), edge_list_, core::graph::EdgeList::end(), and num_nodes_.
|
inline |
returns a const iterator to the beginning of the (unordered) edge list for the graph. this edge list contains all the edges in the graph, not simply those for a particular vertex
Definition at line 770 of file Graph.hh.
References core::graph::EdgeList::const_begin(), and edge_list_.
Referenced by copy_connectivity(), core::pack::create_minimization_graph(), Graph(), and operator=().
|
inline |
returns a const iterator to the end of the (unordered) edge list for the graph. this edge list contains all the edges in the graph, not simply those for a particular vertex
Definition at line 786 of file Graph.hh.
References core::graph::EdgeList::const_end(), and edge_list_.
Referenced by copy_connectivity(), core::pack::create_minimization_graph(), Graph(), and operator=().
| void core::graph::Graph::copy_connectivity | ( | Graph const & | source) |
copy the edge connectivity from a source graph with a potentially unknown type.
copy the connectivity of the source graph, but do not copy the data stored in the nodes and edges of the source graph. Useful for when copying a graph of a different type (e.g. from an EnergyGraph into a Graph)
Definition at line 611 of file Graph.cc.
References add_edge(), const_edge_list_begin(), const_edge_list_end(), drop_all_edges(), num_nodes_, and set_num_nodes().
Referenced by core::pack::stochastic_pack().
|
protectedvirtual |
Reimplemented in core::scoring::MinimizationGraph, core::pack::interaction_graph::SimpleInteractionGraph, core::scoring::EnergyGraph, core::scoring::TenANeighborGraph, core::scoring::constraints::ConstraintGraph, core::scoring::TwelveANeighborGraph, and core::scoring::ContextGraph.
Definition at line 909 of file Graph.cc.
References num_edges_, and num_nodes_.
Referenced by core::scoring::ContextGraph::count_dynamic_memory(), core::scoring::constraints::ConstraintGraph::count_dynamic_memory(), core::scoring::EnergyGraph::count_dynamic_memory(), core::scoring::MinimizationGraph::count_dynamic_memory(), and getTotalMemoryUsage().
|
protectedvirtual |
Reimplemented in core::scoring::MinimizationGraph, core::pack::interaction_graph::SimpleInteractionGraph, core::scoring::EnergyGraph, core::scoring::TenANeighborGraph, core::scoring::constraints::ConstraintGraph, core::scoring::TwelveANeighborGraph, and core::scoring::ContextGraph.
Definition at line 904 of file Graph.cc.
References Graph().
Referenced by getTotalMemoryUsage().
|
protectedvirtual |
factory method for edge creation, defined by derived graph classes, called by the base class
factory method for edge creation Should be overriden in derived classes
Reimplemented in core::scoring::MinimizationGraph, core::pack::interaction_graph::SimpleInteractionGraph, core::scoring::EnergyGraph, core::scoring::TenANeighborGraph, core::scoring::constraints::ConstraintGraph, and core::scoring::TwelveANeighborGraph.
Definition at line 929 of file Graph.cc.
References edge_pool_.
Referenced by add_edge().
factory method for edge copy-construction. Derived class should downcast the example_edge pointer and may read that edge's data.
Reimplemented in core::scoring::MinimizationGraph, core::scoring::EnergyGraph, core::scoring::TenANeighborGraph, core::scoring::constraints::ConstraintGraph, and core::scoring::TwelveANeighborGraph.
Definition at line 934 of file Graph.cc.
References edge_pool_, core::graph::Edge::get_first_node_ind(), and core::graph::Edge::get_second_node_ind().
|
protectedvirtual |
factory method for node creation, defined by derived graph classes, called by the base class
factory method for node creation Should be overriden in derived classes
Reimplemented in core::scoring::MinimizationGraph, core::pack::interaction_graph::SimpleInteractionGraph, core::scoring::EnergyGraph, core::scoring::TenANeighborGraph, core::scoring::constraints::ConstraintGraph, and core::scoring::TwelveANeighborGraph.
Definition at line 922 of file Graph.cc.
References Node.
Referenced by Graph(), and set_num_nodes().
|
virtual |
remove an edge from the graph. (NEW AS OF 12/9/07) Never call C++'s "delete" function on an edge pointer directly. Derived classes must implement this function. If they wish to use unordered_object_pools to manage their memory
Reimplemented in core::scoring::MinimizationGraph, core::pack::interaction_graph::SimpleInteractionGraph, core::scoring::EnergyGraph, core::scoring::TenANeighborGraph, core::scoring::constraints::ConstraintGraph, and core::scoring::TwelveANeighborGraph.
Definition at line 879 of file Graph.cc.
References edge_pool_.
Referenced by core::graph::delete_all_intragroup_edges(), delete_everything(), core::scoring::Energies::delete_graph_edges_using_domain_map(), core::graph::Node::drop_all_edges(), and drop_all_edges().
|
protected |
deallocate all nodes and edges from the graph
deletes each edge in the graph and then deletes each node
its important to note that nodes must outlive their incident edges
Definition at line 826 of file Graph.cc.
References core::graph::EdgeList::begin(), delete_edge(), edge_list_, core::graph::EdgeList::end(), focused_edge_, nodes_, and num_nodes_.
Referenced by set_num_nodes(), core::scoring::constraints::ConstraintGraph::~ConstraintGraph(), core::scoring::EnergyGraph::~EnergyGraph(), ~Graph(), core::scoring::MinimizationGraph::~MinimizationGraph(), core::scoring::TenANeighborGraph::~TenANeighborGraph(), and core::scoring::TwelveANeighborGraph::~TwelveANeighborGraph().
| void core::graph::Graph::drop_all_edges | ( | ) |
delete all the edges present in the graph
deletes all edges in the graph
Definition at line 704 of file Graph.cc.
References core::graph::EdgeList::begin(), delete_edge(), edge_list_, and core::graph::EdgeList::end().
Referenced by core::scoring::EnergyGraph::active_score_types(), copy_connectivity(), and operator=().
| void core::graph::Graph::drop_all_edges_for_node | ( | platform::Size | node) |
delete all the edges for a single vertex in the graph
deletes all edges adjacent to the node specified
| node | - [in] - index of the node |
Definition at line 697 of file Graph.cc.
References core::graph::Node::drop_all_edges(), and get_node().
|
protected |
remove an edge from the entire-graph edge list. Called only by class Edge during its destructor
removes edge from edge list at iterator iter
each edge keeps track of its position in its owner's graph's edge list so it can efficiently delete itself should it need to.
| iter | - [in] - the iterator in the non-const edge list pointing at the edge that's deleting itself |
| citer | - [in] - the iterator in the const edge list pointing at the edge that's deleting itself |
Definition at line 813 of file Graph.cc.
References edge_list_, core::graph::EdgeList::erase(), focused_edge_, and num_edges_.
Referenced by core::graph::Edge::~Edge().
|
inline |
returns a non-const iterator to the beginning of the (unordered) edge list for the graph. this edge list contains all the edges in the graph, not simply those for a particular vertex
Definition at line 778 of file Graph.hh.
References core::graph::EdgeList::begin(), and edge_list_.
Referenced by core::graph::delete_all_intragroup_edges(), core::scoring::Energies::delete_graph_edges_using_domain_map(), core::scoring::symmetry::SymmetricScoreFunction::setup_for_minimizing(), and core::scoring::ScoreFunction::setup_for_minimizing().
|
inlineprotected |
Used by class Node only, this is the pool from which edge lists are to allocate their edge lists elements from.
Definition at line 852 of file Graph.hh.
References edge_list_element_pool_.
|
inline |
returns a non-const iterator to the end of the (unordered) edge list for the graph. this edge list contains all the edges in the graph, not simply those for a particular vertex
Definition at line 794 of file Graph.hh.
References edge_list_, and core::graph::EdgeList::end().
Referenced by core::graph::delete_all_intragroup_edges(), and core::scoring::Energies::delete_graph_edges_using_domain_map().
| Edge * core::graph::Graph::find_edge | ( | platform::Size | node1, |
| platform::Size | node2 | ||
| ) |
returns a pointer to the edge connecting nodes node1 and node2, if that edge exists in the graph, o.w. returns 0. Focuses the graph on this edge for fast subsequent retrieval.
returns the edge connecting node1 and node2
graph keeps a pointer to the last edge that was accessed to that search is fairly efficient.
| node1 | - [in] - index of the first node |
| node2 | - [in] - index of the second node |
Definition at line 870 of file Graph.cc.
References focused_edge_, nodes_, and core::graph::Edge::same_edge().
Referenced by core::pack::compare_mingraph_and_energy_graph(), core::pack::compare_simple_inteaction_graph_alt_state_and_energy_graph(), core::scoring::EnergyGraph::find_energy_edge(), core::scoring::MinimizationGraph::find_minimization_edge(), get_edge_exists(), Graph(), core::pack::interaction_graph::SimpleInteractionGraph::initialize(), and core::scoring::ScoreFunction::setup_for_lr2benmeth_minimization_for_respair().
| Edge const * core::graph::Graph::find_edge | ( | platform::Size | node1, |
| platform::Size | node2 | ||
| ) | const |
returns a const pointer to the edge connecting nodes node1 and node2, if that edge exists in the graph, o.w. returns 0. Focuses the graph on this edge for fast subsequent retrieval.
returns the edge connecting node1 and node2 (const version)
graph keeps a pointer to the last edge that was accessed to that search is fairly efficient.
| node1 | - [in] - index of the first node |
| node2 | - [in] - index of the second node |
Definition at line 852 of file Graph.cc.
References focused_edge_, nodes_, and core::graph::Edge::same_edge().
|
inline |
returns a pointer to the focused edge
Definition at line 807 of file Graph.hh.
References focused_edge_.
|
inline |
returns a const-pointer to the focused edge
Definition at line 809 of file Graph.hh.
References focused_edge_.
| bool core::graph::Graph::get_edge_exists | ( | platform::Size | node1, |
| platform::Size | node2 | ||
| ) | const |
is an edge already present in the graph? O(V) worst case. O(1) iff all vertices have O(1) edges
returns true if an edge between node1 and node2 exists
| node1 | - [in] - index of the one of the nodes |
| node2 | - [in] - index of the other node |
Definition at line 688 of file Graph.cc.
References find_edge().
Referenced by add_edge(), and core::pack::interaction_graph::SimpleInteractionGraph::initialize().
|
inline |
Definition at line 747 of file Graph.hh.
References nodes_, and num_nodes_.
Referenced by protocols::toolbox::rotamer_set_operations::RigidBodyMoveBaseRSO::alter_rotamer_set(), core::pack::rotamer_set::RotamerSet_::build_rotamers_for_concrete(), protocols::features::helixAssembly::HelixBundleFeatures::calc_fa_energy(), protocols::enzdes::PackRotamersMoverPartGreedy::choose_n_best(), core::pack::interaction_graph::SimpleInteractionGraph::commit_change(), protocols::toolbox::pose_metric_calculators::NumberHBondsCalculator::compute_Hbonds_for_residue(), core::pack::rotamer_set::RotamerSet_::compute_one_body_energy_maps(), core::scoring::geometric_solvation::ExactOccludedHbondSolEnergy::compute_polar_group_sol_energy(), core::pack::interaction_graph::SurfacePotential::compute_pose_surface_energy(), core::pack::interaction_graph::SimpleInteractionGraph::consider_substitution(), core::pack::scmin::CartSCMinMultifunc::dfunc(), core::pack::scmin::SCMinMultifunc::dfunc(), drop_all_edges_for_node(), core::scoring::hbonds::HBondEnergy::evaluate_rotamer_background_energies(), core::scoring::hbonds::HBondEnergy::evaluate_rotamer_pair_energies(), protocols::hotspot_hashing::HotspotStubSet::evaluate_stub_bumps_(), protocols::hotspot_hashing::HotspotStubSet::evaluate_stub_self_energy_(), protocols::enzdes::EnzdesFlexibleRegion::extract_lig_designability_score(), core::scoring::WaterAdductHBondPotential::fill_h2o_hbond_set(), core::scoring::hbonds::fill_hbond_set(), core::graph::find_connected_components(), protocols::enzdes::EnzdesFlexibleRegion::get_12A_neighbors(), core::scoring::EnergyGraph::get_energy_node(), core::scoring::MinimizationGraph::get_minimization_node(), protocols::optimize_weights::IterativeOptEDriver::get_nat_aa_opte_data(), core::pack::interaction_graph::SimpleInteractionGraph::get_simple_node(), core::pack::interaction_graph::SimpleInteractionGraph::initialize(), core::pack::interaction_graph::SurfaceNode< V, E, G >::initialize_num_neighbors_counting_self(), core::pack::interaction_graph::SurfaceBackgroundNode< V, E, G >::initialize_num_neighbors_counting_self(), protocols::simple_filters::RotamerBoltzmannWeight::interface_interaction_energy(), protocols::match::NumNeighborsMPM::modified_match_positions(), core::pack::scmin::CartSCMinMultifunc::operator()(), core::pack::scmin::SCMinMultifunc::operator()(), core::pack::interaction_graph::LinearMemNode::project_deltaE_for_substitution(), protocols::toolbox::pose_metric_calculators::NonlocalContactsCalculator::recompute(), core::pack::reinitialize_mingraph_neighborhood_for_residue(), core::pack::interaction_graph::SimpleInteractionGraph::reject_change(), core::scoring::geometric_solvation::OccludedHbondSolEnergy_onebody::residue_energy(), core::scoring::geometric_solvation::ExactOccludedHbondSolEnergy::residue_energy(), core::pack::interaction_graph::SimpleInteractionGraph::set_pose_no_initialize(), core::io::sequence_comparation::DesignContrast::setNeighbors(), core::scoring::hbonds::HBondEnergy::sidechain_sidechain_energy(), protocols::scoring::Interface::symmetric_protein_calculate(), core::optimization::symmetry::SymMinimizerMap::SymMinimizerMap(), core::pack::interaction_graph::SimpleInteractionGraph::total_energy(), and core::scoring::symmetry::SymmetricEnergies::update_neighbor_links().
|
inline |
Definition at line 754 of file Graph.hh.
References nodes_, and num_nodes_.
| platform::Size core::graph::Graph::getTotalMemoryUsage | ( | ) | const |
returns a count of all the memory used by every vertex and edge in a graph by invoking the polymorphic count_static_memory and count_dynamic_memory of each (possibly derived) node and edge object as well as for the (possibly derived) graph class.
Definition at line 885 of file Graph.cc.
References core::graph::EdgeList::const_begin(), core::graph::EdgeList::const_end(), count_dynamic_memory(), count_static_memory(), edge_list_, nodes_, and num_nodes().
|
inline |
|
inline |
the number of nodes in the graph
Definition at line 709 of file Graph.hh.
References num_nodes_.
Referenced by core::graph::delete_all_intragroup_edges(), core::graph::find_connected_components(), getTotalMemoryUsage(), Graph(), core::pack::interaction_graph::SimpleInteractionGraph::initialize(), set_num_nodes(), core::pack::interaction_graph::SimpleInteractionGraph::set_pose_no_initialize(), and protocols::scoring::Interface::symmetric_protein_calculate().
assignment operator. source and this must have the same type.
operator = (). Relies on factory methods and virtual "copy_from" methods
operator= must only be performed on graphs of the same type e.g. an EnergyGraph may be copied from another EnergyGraph, but should not be copied from a Graph.
Definition at line 588 of file Graph.cc.
References add_edge(), const_edge_list_begin(), const_edge_list_end(), drop_all_edges(), nodes_, num_nodes_, and set_num_nodes().
Referenced by core::scoring::constraints::ConstraintGraph::ConstraintGraph(), core::scoring::EnergyGraph::EnergyGraph(), core::scoring::MinimizationGraph::MinimizationGraph(), core::scoring::ContextGraph::operator=(), core::scoring::constraints::ConstraintGraph::operator=(), core::scoring::EnergyGraph::operator=(), and core::scoring::MinimizationGraph::operator=().
| void core::graph::Graph::output_connectivity | ( | std::ostream & | os) | const |
send an edge list to the stream os.
writes out a list of all the edges in the graph
| os | - [in] - the output stream to write to |
Definition at line 729 of file Graph.cc.
References core::graph::EdgeList::begin(), edge_list_, and core::graph::EdgeList::end().
| void core::graph::Graph::output_dimacs | ( | std::ostream & | os) | const |
describe this graph in dimacs form to the stream os.
writes out a connectivity description of the graph in the famous dimacs format. (where the first column "DIMACS:" should be sed'ed out)
| os | - [in] - the output stream to write to |
Definition at line 744 of file Graph.cc.
References core::graph::EdgeList::begin(), edge_list_, core::graph::EdgeList::end(), num_edges(), num_nodes_, and core::graph::EdgeList::size().
| void core::graph::Graph::print_vertices | ( | ) | const |
send summary information to the screen for all vertices in the graph
calls print() on each of the nodes in the graph
Definition at line 719 of file Graph.cc.
References nodes_, and num_nodes_.
| void core::graph::Graph::set_num_nodes | ( | platform::Size | num_nodes) |
set the number of nodes in the graph – deletes any existing edges in the graph
alternative to integer constructor; first create an empty graph and later tell the graph how many nodes it has. If the graph is not already empty, it will delete everything its holding.
Definition at line 676 of file Graph.cc.
References create_new_node(), delete_everything(), nodes_, num_nodes(), and num_nodes_.
Referenced by core::scoring::constraints::ConstraintGraph::ConstraintGraph(), copy_connectivity(), core::scoring::EnergyGraph::EnergyGraph(), core::chemical::get_residue_path_distances(), core::pack::interaction_graph::SimpleInteractionGraph::initialize(), core::scoring::MinimizationGraph::MinimizationGraph(), operator=(), core::pack::interaction_graph::SimpleInteractionGraph::set_pose_no_initialize(), core::scoring::TenANeighborGraph::TenANeighborGraph(), and core::scoring::TwelveANeighborGraph::TwelveANeighborGraph().
|
friend |
Definition at line 822 of file Graph.hh.
Referenced by create_new_node().
|
private |
Definition at line 863 of file Graph.hh.
Referenced by add_edge(), all_pairs_shortest_paths(), const_edge_list_begin(), const_edge_list_end(), delete_everything(), drop_all_edges(), drop_edge(), edge_list_begin(), edge_list_end(), getTotalMemoryUsage(), output_connectivity(), and output_dimacs().
|
private |
the pool from which edge lists are to allocate their edge list elements
Definition at line 862 of file Graph.hh.
Referenced by edge_list_element_pool(), and ~Graph().
|
private |
the pool from which class Graph allocates Edge objects. Not used by derived classes
Definition at line 867 of file Graph.hh.
Referenced by create_new_edge(), delete_edge(), and ~Graph().
|
mutableprivate |
Quick-access to a frequently needed edge – the most recently sought edge in a call to find_edge() or the most recently added edge.
Definition at line 871 of file Graph.hh.
Referenced by add_edge(), delete_everything(), drop_edge(), find_edge(), and focused_edge().
|
private |
Definition at line 858 of file Graph.hh.
Referenced by delete_everything(), core::graph::Edge::Edge(), find_edge(), get_node(), getTotalMemoryUsage(), Graph(), operator=(), print_vertices(), and set_num_nodes().
|
private |
Definition at line 859 of file Graph.hh.
Referenced by add_edge(), count_dynamic_memory(), drop_edge(), and num_edges().
|
private |
Definition at line 857 of file Graph.hh.
Referenced by all_pairs_shortest_paths(), copy_connectivity(), count_dynamic_memory(), delete_everything(), get_node(), Graph(), num_nodes(), operator=(), output_dimacs(), print_vertices(), and set_num_nodes().
1.8.4