Analysis Software
Documentation for sPHENIX simulation software
|
A directed or undirected graph. More...
#include <JETSCAPE/blob/main/external_packages/gtl/include/GTL/graph.h>
Public Types | |
typedef list< node > ::const_iterator | node_iterator |
typedef list< edge > ::const_iterator | edge_iterator |
Private Member Functions | |
int | new_node_id () |
int | new_edge_id () |
void | copy (const graph &G, list< node >::const_iterator it, list< node >::const_iterator end) |
void | del_list (list< node > &) |
void | del_list (list< edge > &) |
Private Attributes | |
bool | directed |
list< node > | nodes |
list< edge > | edges |
int | nodes_count |
int | edges_count |
list< node > | hidden_nodes |
list< edge > | hidden_edges |
int | hidden_nodes_count |
int | hidden_edges_count |
list< int > | free_node_ids |
list< int > | free_edge_ids |
int | free_node_ids_count |
int | free_edge_ids_count |
Friends | |
GTL_EXTERN friend ostream & | operator<< (ostream &os, const graph &G) |
A directed or undirected graph.
A graph G=(V,E) consists of a set of nodes V and a set of edges E , where every edge can be viewed as a (ordered) pair of nodes (u,v) connecting source u with target v . Obviously this implies a direction on the edges, which is why we call these graphs directed (this is the default). A graph can be made undirected by just ignoring the (implicit) direction.
Definition at line 42 of file graph.h.
View newest version in sPHENIX GitHub at line 42 of file graph.h
typedef list<edge>::const_iterator graph::edge_iterator |
typedef list<node>::const_iterator graph::node_iterator |
__GTL_BEGIN_NAMESPACE graph::graph | ( | ) |
graph::graph | ( | const graph & | G | ) |
Copy constructor. Please note: This will generate an isomorpic copy of G
. Although this graph will look like G
it is not physically the same. Especially it consists of nodes and edges, which of course have counterparts in G
, but are different. This means that the nodes (edges) in the copy have undefined behaviour if used within a node_map (edge_map ) of the original graph.
<code>G</code> | graph |
Definition at line 54 of file graph.cpp.
View newest version in sPHENIX GitHub at line 54 of file graph.cpp
Makes new graph isomorphic to the subgraph induced by nodes
. The same restriction as for the ordinary copy constructor applies to this one.
<code>G</code> | graph |
<code>nodes</code> | nodes of G , which form the induced subgraph this graph will be isomorphic to. |
Definition at line 64 of file graph.cpp.
View newest version in sPHENIX GitHub at line 64 of file graph.cpp
References copy().
Makes new graph isomorphic to the subgraph induced by the nodes in the range from it
to end
The same restriction as for the ordinary copy constructor applies to this one.
<code>G</code> | graph |
<code>it</code> | beginning of nodes |
<code>end</code> | end of nodes |
Definition at line 74 of file graph.cpp.
View newest version in sPHENIX GitHub at line 74 of file graph.cpp
References copy().
|
virtual |
|
inlinevirtual |
Called after writing the graph key to os
. This can be used to write top-level keys that should appear after the graph in the file.
<code>os</code> | output stream. |
Definition at line 705 of file graph.h.
View newest version in sPHENIX GitHub at line 705 of file graph.h
Referenced by save().
list< edge > graph::all_edges | ( | ) | const |
list< node > graph::all_nodes | ( | ) | const |
node graph::center | ( | ) | const |
Returns a center of the graph which is defined as a node with maximum excentricity.
Definition at line 462 of file graph.cpp.
View newest version in sPHENIX GitHub at line 462 of file graph.cpp
References node::excentricity(), forall_nodes, n, and number_of_nodes().
node graph::choose_node | ( | ) | const |
Definition at line 828 of file graph.cpp.
View newest version in sPHENIX GitHub at line 828 of file graph.cpp
References nodes.
Referenced by bfs::run(), and dfs::run().
void graph::clear | ( | ) |
Deletes all nodes and edges, even the hidden ones
Definition at line 337 of file graph.cpp.
View newest version in sPHENIX GitHub at line 337 of file graph.cpp
References del_list(), edges, edges_count, free_edge_ids, free_edge_ids_count, free_node_ids, free_node_ids_count, hidden_edges, hidden_edges_count, hidden_nodes, hidden_nodes_count, nodes, nodes_count, post_clear_handler(), and pre_clear_handler().
Referenced by ColoredHadronization::DoHadronization(), load(), and ~graph().
|
private |
Definition at line 85 of file graph.cpp.
View newest version in sPHENIX GitHub at line 85 of file graph.cpp
References new_edge(), and new_node().
Referenced by graph().
void graph::del_all_edges | ( | ) |
Definition at line 369 of file graph.cpp.
View newest version in sPHENIX GitHub at line 369 of file graph.cpp
References assert, del_list(), edges, edges_count, end, it, and nodes.
void graph::del_all_nodes | ( | ) |
Definition at line 356 of file graph.cpp.
View newest version in sPHENIX GitHub at line 356 of file graph.cpp
References assert, del_list(), edges, edges_count, nodes, and nodes_count.
void graph::del_edge | ( | edge | e | ) |
Deletes edge e
.
Precondition: e
is a valid visible edge in this graph.
<code>e</code> | edge to be deleted |
Definition at line 317 of file graph.cpp.
View newest version in sPHENIX GitHub at line 317 of file graph.cpp
References assert, edge::data, edges, edges_count, free_edge_ids, free_edge_ids_count, edge_data::id, edge_data::owner, edge_data::pos, post_del_edge_handler(), pre_del_edge_handler(), edge::remove_from(), physmon_simulation::s, edge::source(), t, and edge::target().
Referenced by del_node(), ratio_cut_partition::restore(), maxflow_ff::restore_graph(), maxflow_sap::restore_graph(), maxflow_pp::restore_graph(), and planarity::run().
|
private |
Definition at line 772 of file graph.cpp.
View newest version in sPHENIX GitHub at line 772 of file graph.cpp
Referenced by clear(), del_all_edges(), and del_all_nodes().
|
private |
void graph::del_node | ( | node | n | ) |
Deletes node n
, and thus all edges incident with n
.
Precondition: n
is a valid visible node in this graph
<code>n</code> | visible node to be deleted |
Definition at line 264 of file graph.cpp.
View newest version in sPHENIX GitHub at line 264 of file graph.cpp
References assert, node::data, del_edge(), end, free_node_ids, free_node_ids_count, hidden_edges, node_data::id, node::in_edges_begin(), node::in_edges_end(), it, n, nodes, nodes_count, node::out_edges_begin(), node::out_edges_end(), node_data::owner, node_data::pos, post_del_node_handler(), and pre_del_node_handler().
Referenced by maxflow_ff::restore_graph(), maxflow_sap::restore_graph(), and maxflow_pp::restore_graph().
graph::edge_iterator graph::edges_begin | ( | ) | const |
Iterate through all edges in the graph.
Definition at line 492 of file graph.cpp.
View newest version in sPHENIX GitHub at line 492 of file graph.cpp
References edges.
Referenced by maxflow_ff::check(), maxflow_pp::check(), maxflow_sap::check(), bid_dijkstra::check(), dijkstra::check(), fm_partition::check(), ratio_cut_partition::check(), fm_partition::clean_pass(), ratio_cut_partition::clean_step(), maxflow_pp::comp_rem_net(), fm_partition::compute_cut_edges(), ratio_cut_partition::compute_cut_edges(), Jetscape::PartonShower::GetEdgeAt(), Jetscape::PartonShower::GetFinalPartons(), Jetscape::PartonShower::GetPartonAt(), fm_partition::hide_self_loops(), fm_partition::init_data_structure(), ratio_cut_partition::init_data_structure(), biconnectivity::init_handler(), fm_partition::init_variables(), ratio_cut_partition::init_variables(), Martini::isCoherent(), main(), shower2::pre_clear_handler(), Jetscape::PartonShower::pre_clear_handler(), Jetscape::PartonShower::PrintEdges(), min_tree::run(), bellman_ford::run(), bid_dijkstra::run(), planarity::run_on_biconnected(), save(), Jetscape::PartonShower::SaveAsGraphML(), and Jetscape::PartonShower::SaveAsGV().
graph::edge_iterator graph::edges_end | ( | ) | const |
Iterate through all edges in the graph.
Definition at line 497 of file graph.cpp.
View newest version in sPHENIX GitHub at line 497 of file graph.cpp
References edges.
Referenced by maxflow_ff::check(), maxflow_pp::check(), maxflow_sap::check(), bid_dijkstra::check(), dijkstra::check(), fm_partition::check(), ratio_cut_partition::check(), fm_partition::clean_pass(), ratio_cut_partition::clean_step(), maxflow_pp::comp_rem_net(), fm_partition::compute_cut_edges(), ratio_cut_partition::compute_cut_edges(), Jetscape::PartonShower::GetFinalPartons(), fm_partition::hide_self_loops(), fm_partition::init_data_structure(), ratio_cut_partition::init_data_structure(), biconnectivity::init_handler(), fm_partition::init_variables(), ratio_cut_partition::init_variables(), Martini::isCoherent(), main(), shower2::pre_clear_handler(), Jetscape::PartonShower::pre_clear_handler(), Jetscape::PartonShower::PrintEdges(), min_tree::run(), bellman_ford::run(), bid_dijkstra::run(), planarity::run_on_biconnected(), save(), Jetscape::PartonShower::SaveAsGraphML(), and Jetscape::PartonShower::SaveAsGV().
void graph::hide_edge | ( | edge | e | ) |
Hides an edge.
Precondition: e
is a valid edge in this graph
<code>e</code> | edge to be hidden |
Definition at line 522 of file graph.cpp.
View newest version in sPHENIX GitHub at line 522 of file graph.cpp
References edge_data::adj_pos, assert, edge::data, Acts::UnitConstants::e, edges, edge_data::hidden, hidden_edges, hidden_edges_count, edge::is_hidden(), edge_data::owner, edge_data::pos, post_hide_edge_handler(), pre_hide_edge_handler(), and edge::remove_from().
Referenced by maxflow_sap::augment(), maxflow_pp::comp_rem_net(), maxflow_ff::comp_single_flow(), hide_node(), fm_partition::hide_self_loops(), biconnectivity::init_handler(), maxflow_pp::leveling(), maxflow_pp::pull(), and maxflow_pp::push().
Hides a node. Please note: all the edges incident with n
will be hidden, too. All these edges are returned in a list.
Precondition: n
is a valid node in this graph
<code>e</code> | node to be hidden |
Definition at line 617 of file graph.cpp.
View newest version in sPHENIX GitHub at line 617 of file graph.cpp
References assert, node::data, node_data::edges, end, node_data::hidden, hidden_nodes, hidden_nodes_count, hide_edge(), i, node::is_hidden(), nodes, node_data::owner, node_data::pos, post_hide_node_handler(), and pre_hide_node_handler().
Referenced by maxflow_pp::hide_unreachable_nodes(), and induced_subgraph().
void graph::induced_subgraph | ( | list< node > & | subgraph_nodes | ) |
Hides all nodes not contained in subgraph_nodes
, i.e. (the visible part of) the graph is the induced subgraph with respect to the nodes in subgraph_nodes
. It is allowed to apply this function recursively, i.e. one may call induced_subgraph
on a graph that is already a induced subgraph.
<code>subgraph_nodes</code> | nodes of subgraph. |
Definition at line 677 of file graph.cpp.
View newest version in sPHENIX GitHub at line 677 of file graph.cpp
References end, hide_node(), it, nodes, and Acts::Test::tmp().
Referenced by planarity::switch_to_component().
list< edge > graph::insert_reverse_edges | ( | ) |
Definition at line 804 of file graph.cpp.
View newest version in sPHENIX GitHub at line 804 of file graph.cpp
References Acts::UnitConstants::e, end, forall_edges, it, new_edge(), node::out_edges_begin(), node::out_edges_end(), edge::source(), and edge::target().
bool graph::is_acyclic | ( | ) | const |
Test whether the graph is acyclic
Definition at line 444 of file graph.cpp.
View newest version in sPHENIX GitHub at line 444 of file graph.cpp
References topsort::is_acyclic(), dfs::run(), and t.
Checks if for all edges (v, w) the reverse edge (w,v) is present, too. Additionally the reverse of some edge e
will be stored as rev[e]
. If there is no reverse edge of e
rev[e]
will be the invalid edge edge()
.
<code>rev</code> | map associating every edge with its reverse edge. |
Definition at line 395 of file graph.cpp.
View newest version in sPHENIX GitHub at line 395 of file graph.cpp
References end, forall_edges, it, node::out_edges_begin(), node::out_edges_end(), edge::source(), parse_cmake_options::source, edge::target(), and material_mapping_optimisation::target.
bool graph::is_connected | ( | ) | const |
Test whether the graph is connected
Definition at line 431 of file graph.cpp.
View newest version in sPHENIX GitHub at line 431 of file graph.cpp
References directed, number_of_nodes(), dfs::number_of_reached_nodes(), and dfs::run().
Referenced by min_tree::check(), maxflow_ff::check(), maxflow_pp::check(), maxflow_sap::check(), and ratio_cut_partition::run().
bool graph::is_directed | ( | ) | const |
Test whether the graph is directed.
Definition at line 170 of file graph.cpp.
View newest version in sPHENIX GitHub at line 170 of file graph.cpp
References directed.
Referenced by min_tree::check(), topsort::check(), st_number::check(), node::is_directed(), operator<<(), planarity::run(), and bid_dijkstra::run().
bool graph::is_undirected | ( | ) | const |
Test whether the graph is undirected.
Definition at line 175 of file graph.cpp.
View newest version in sPHENIX GitHub at line 175 of file graph.cpp
References directed.
Referenced by components::check(), biconnectivity::check(), maxflow_ff::check(), maxflow_pp::check(), maxflow_sap::check(), fm_partition::check(), ratio_cut_partition::check(), node::is_undirected(), and bellman_ford::run().
Load graph from a file in GML-format. The optional parameter preserve_ids
controls whether to give the nodes the same ids as in the GML file. You can enable this for debugging but you should disable it for final releases since it may make node_map
unecessarily large.
<code>filename</code> | file in GML-format. |
<code>preserve_ids</code> | if true all the nodes will get the same id as in the GML file. If false (default) the nodes will be numbered consecutively beginning with 0. However the order of the nodes in the GML file will be preserved. |
Definition at line 401 of file graph.h.
View newest version in sPHENIX GitHub at line 401 of file graph.h
References load().
Referenced by load(), and main().
Load graph from a file in GML-format. The optional parameter preserve_ids
controls whether to give the nodes the same ids as in the GML file. You can enable this for debugging but you should disable it for final releases since it may make node_map
unecessarily large.
<code>filename</code> | file in GML-format. |
<code>preserve_ids</code> | if true all the nodes will get the same id as in the GML file. If false (default) the nodes will be numbered consecutively beginning with 0. However the order of the nodes in the GML file will be preserved. |
Definition at line 838 of file graph.cpp.
View newest version in sPHENIX GitHub at line 838 of file graph.cpp
References assert, clear(), node::data, directed, Acts::UnitConstants::e, end, GML_stat::err, GML_error::err_num, fclose(), file, free_node_ids_count, GML_FILE_NOT_FOUND, GML_free_list(), GML_init(), GML_INT, GML_LIST, GML_OK, GML_parser(), node_data::id, GML_pair_val::integer, it, GML_pair::key, GML_stat::key_list, GML_pair::kind, GML_pair_val::list, load_edge_info_handler(), load_graph_info_handler(), load_node_info_handler(), n, new_edge(), new_node(), GML_pair::next, Acts::Experimental::detail::BlueprintHelper::sort(), parse_cmake_options::source, material_mapping_optimisation::target, top_level_key_handler(), and GML_pair::value.
Called after an edge is created. The whole list of key-value-pairs belonging to this edge is passed to this handler together with the edge itself.
<code>e</code> | edge parsed |
<code>list</code> | pointer to the list of key-value-pairs of this edge. |
Reimplemented in Jetscape::PartonShower, shower2, and shower2.
Definition at line 1033 of file graph.cpp.
View newest version in sPHENIX GitHub at line 1033 of file graph.cpp
Referenced by load().
|
virtual |
Called after the graph is completely built. The whole list for the graph key used to build this graph is passed to this handler.
<code>list</code> | pointer to the list of key-value-pairs of the graph. |
Definition at line 1036 of file graph.cpp.
View newest version in sPHENIX GitHub at line 1036 of file graph.cpp
Referenced by load().
Called after a node is created. The whole list of key-value-pairs belonging to this node is passed to this handler together with the node itself.
<code>n</code> | node parsed |
<code>list</code> | pointer to the list of key-value-pairs of this node. |
Reimplemented in shower2, Jetscape::PartonShower, and shower2.
Definition at line 1029 of file graph.cpp.
View newest version in sPHENIX GitHub at line 1029 of file graph.cpp
Referenced by load().
void graph::make_directed | ( | ) |
Makes graph directed.
Definition at line 150 of file graph.cpp.
View newest version in sPHENIX GitHub at line 150 of file graph.cpp
References directed, post_make_directed_handler(), and pre_make_directed_handler().
Referenced by main(), and planarity::run().
void graph::make_undirected | ( | ) |
Makes graph undirected.
Definition at line 160 of file graph.cpp.
View newest version in sPHENIX GitHub at line 160 of file graph.cpp
References directed, post_make_undirected_handler(), and pre_make_undirected_handler().
Referenced by planarity::run().
Adds new edge from s
to t
.
Precondition: s,t
are valid nodes in this graph.
<code>s</code> | source of new edge |
<code>t</code> | target of new edge |
Definition at line 208 of file graph.cpp.
View newest version in sPHENIX GitHub at line 208 of file graph.cpp
References edge_data::adj_pos, assert, edge::data, node::data, Acts::UnitConstants::e, node_data::edges, edges, edges_count, edge_data::hidden, edge_data::id, new_edge_id(), edge_data::nodes, node_data::owner, edge_data::owner, edge_data::pos, post_new_edge_handler(), and pre_new_edge_handler().
Referenced by biconnectivity::after_recursive_call_handler(), copy(), maxflow_ff::create_artif_source_target(), maxflow_sap::create_artif_source_target(), maxflow_pp::create_artif_source_target(), maxflow_ff::create_back_edge(), maxflow_sap::create_back_edge(), maxflow_pp::create_back_edge(), biconnectivity::init_handler(), insert_reverse_edges(), load(), main(), ratio_cut_partition::make_connected(), my_graph::new_parton(), Jetscape::PartonShower::new_parton(), shower2::new_parton(), and shower::new_parton().
|
private |
Definition at line 757 of file graph.cpp.
View newest version in sPHENIX GitHub at line 757 of file graph.cpp
References edges_count, free_edge_ids, free_edge_ids_count, and train_ambiguity_solver::id.
Referenced by new_edge().
|
virtual |
Adds a new node.
Definition at line 184 of file graph.cpp.
View newest version in sPHENIX GitHub at line 184 of file graph.cpp
References node::data, node_data::hidden, node_data::id, n, new_node_id(), nodes, nodes_count, node_data::owner, node_data::pos, post_new_node_handler(), and pre_new_node_handler().
Referenced by copy(), maxflow_ff::create_artif_source_target(), maxflow_sap::create_artif_source_target(), maxflow_pp::create_artif_source_target(), load(), main(), my_graph::new_vertex(), Jetscape::PartonShower::new_vertex(), shower2::new_vertex(), and shower::new_vertex().
|
private |
Definition at line 746 of file graph.cpp.
View newest version in sPHENIX GitHub at line 746 of file graph.cpp
References free_node_ids, free_node_ids_count, train_ambiguity_solver::id, and nodes_count.
Referenced by new_node().
graph::node_iterator graph::nodes_begin | ( | ) | const |
Iterate through all nodes in the graph.
Definition at line 482 of file graph.cpp.
View newest version in sPHENIX GitHub at line 482 of file graph.cpp
References nodes.
Referenced by bellman_ford::check(), maxflow_ff::check(), maxflow_pp::check(), maxflow_sap::check(), bid_dijkstra::check(), dijkstra::check(), fm_partition::check(), ratio_cut_partition::check(), fm_partition::compute_max_vertex_degree(), ratio_cut_partition::compute_max_vertex_degree(), fm_partition::compute_nodesAB(), ratio_cut_partition::compute_nodesAB(), ratio_cut_partition::compute_target_node(), fm_partition::copy_side_node_map(), ratio_cut_partition::copy_side_node_map(), maxflow_ff::create_artif_source_target(), maxflow_sap::create_artif_source_target(), maxflow_pp::create_artif_source_target(), fm_partition::create_initial_bipart(), ratio_cut_partition::determine_source_node(), fm_partition::divide_up(), ratio_cut_partition::divide_up(), fm_partition::get_weight_on_sideA(), ratio_cut_partition::get_weight_on_sideA(), fm_partition::get_weight_on_sideB(), ratio_cut_partition::get_weight_on_sideB(), Jetscape::PartonShower::GetNodeAt(), Jetscape::PartonShower::GetVertexAt(), maxflow_pp::hide_unreachable_nodes(), dijkstra::init(), fm_partition::init_filling_buckets(), ratio_cut_partition::init_filling_buckets(), fm_partition::init_variables(), ratio_cut_partition::initialization(), main(), maxflow_pp::min_throughput_node(), operator<<(), shower2::pre_clear_handler(), Jetscape::PartonShower::pre_clear_handler(), Jetscape::PartonShower::PrintNodes(), bellman_ford::run(), ratio_cut_partition::run(), save(), Jetscape::PartonShower::SaveAsGraphML(), and Jetscape::PartonShower::SaveAsGV().
graph::node_iterator graph::nodes_end | ( | ) | const |
Iterate through all nodes in the graph.
Definition at line 487 of file graph.cpp.
View newest version in sPHENIX GitHub at line 487 of file graph.cpp
References nodes.
Referenced by bellman_ford::check(), maxflow_ff::check(), maxflow_pp::check(), maxflow_sap::check(), bid_dijkstra::check(), dijkstra::check(), fm_partition::check(), ratio_cut_partition::check(), fm_partition::compute_max_vertex_degree(), ratio_cut_partition::compute_max_vertex_degree(), fm_partition::compute_nodesAB(), ratio_cut_partition::compute_nodesAB(), fm_partition::copy_side_node_map(), ratio_cut_partition::copy_side_node_map(), maxflow_ff::create_artif_source_target(), maxflow_sap::create_artif_source_target(), maxflow_pp::create_artif_source_target(), fm_partition::create_initial_bipart(), fm_partition::divide_up(), ratio_cut_partition::divide_up(), fm_partition::get_weight_on_sideA(), ratio_cut_partition::get_weight_on_sideA(), fm_partition::get_weight_on_sideB(), ratio_cut_partition::get_weight_on_sideB(), maxflow_pp::hide_unreachable_nodes(), dijkstra::init(), fm_partition::init_filling_buckets(), ratio_cut_partition::init_filling_buckets(), fm_partition::init_variables(), ratio_cut_partition::initialization(), main(), maxflow_pp::min_throughput_node(), operator<<(), shower2::pre_clear_handler(), Jetscape::PartonShower::pre_clear_handler(), Jetscape::PartonShower::PrintNodes(), save(), Jetscape::PartonShower::SaveAsGraphML(), and Jetscape::PartonShower::SaveAsGV().
int graph::number_of_edges | ( | ) | const |
Returns the number of (visible) edges in the graph
Definition at line 457 of file graph.cpp.
View newest version in sPHENIX GitHub at line 457 of file graph.cpp
References edges_count, and hidden_edges_count.
Referenced by Jetscape::PartonShower::GetNumberOfPartons(), and planarity::run_on_biconnected().
int graph::number_of_ids | ( | node | ) | const |
Definition at line 732 of file graph.cpp.
View newest version in sPHENIX GitHub at line 732 of file graph.cpp
References free_node_ids_count, and nodes_count.
Referenced by main().
int graph::number_of_ids | ( | edge | ) | const |
Definition at line 739 of file graph.cpp.
View newest version in sPHENIX GitHub at line 739 of file graph.cpp
References edges_count, and free_edge_ids_count.
int graph::number_of_nodes | ( | ) | const |
Returns the number of nodes in the graph.
Definition at line 452 of file graph.cpp.
View newest version in sPHENIX GitHub at line 452 of file graph.cpp
References hidden_nodes_count, and nodes_count.
Referenced by center(), min_tree::check(), maxflow_ff::check(), maxflow_pp::check(), maxflow_sap::check(), ratio_cut_partition::check(), fm_partition::create_initial_bipart(), ratio_cut_partition::determine_source_node(), Jetscape::PartonShower::GetNumberOfVertices(), topsort::init_handler(), is_connected(), ratio_cut_partition::left_shift_op(), fm_partition::move_manager(), ratio_cut_partition::move_manager(), pathfinder::pathfinder(), ratio_cut_partition::right_shift_op(), min_tree::run(), bellman_ford::run(), maxflow_sap::run(), bfs::run(), dfs::run(), bid_dijkstra::run(), dijkstra::run(), ratio_cut_partition::run(), and planarity::run_on_biconnected().
|
inlinevirtual |
Virtual function called after the graph was cleared; can be redefined in a derived class for customization Please note: Although nodes and edges are deleted during graph::clear this is not achieved by calling graph::del_node and graph::del_edge, which is why the correspondig handler will not be called.
Definition at line 613 of file graph.h.
View newest version in sPHENIX GitHub at line 613 of file graph.h
Referenced by clear().
Virtual function called after a edge was deleted; can be redefined in a derived class for customization
<code>s</code> | source of edge deleted |
<code>t</code> | target of edge deleted |
Definition at line 551 of file graph.h.
View newest version in sPHENIX GitHub at line 551 of file graph.h
Referenced by del_edge().
|
inlinevirtual |
Virtual function called after a node was deleted; can be redefined in a derived class for customization
Definition at line 475 of file graph.h.
View newest version in sPHENIX GitHub at line 475 of file graph.h
Referenced by del_node().
|
inlinevirtual |
Virtual function called after a edge got hidden; can be redefined in a derived class for customization
<code>e</code> | hidden edge |
Definition at line 569 of file graph.h.
View newest version in sPHENIX GitHub at line 569 of file graph.h
Referenced by hide_edge().
|
inlinevirtual |
Virtual function called after a node got hidden; can be redefined in a derived class for customization
<code>n</code> | hidden node |
Definition at line 493 of file graph.h.
View newest version in sPHENIX GitHub at line 493 of file graph.h
Referenced by hide_node().
|
inlinevirtual |
Virtual function called after performing make_directed; (only if graph was undirected) can be redefined in a derived class for customization
Definition at line 631 of file graph.h.
View newest version in sPHENIX GitHub at line 631 of file graph.h
Referenced by make_directed().
|
inlinevirtual |
Virtual function called after performing make_undirected; (only if graph was directed) can be redefined in a derived class for customization
Definition at line 649 of file graph.h.
View newest version in sPHENIX GitHub at line 649 of file graph.h
Referenced by make_undirected().
|
inlinevirtual |
Virtual function called after a new edge was inserted; can be redefined in a derived class for customization
<code>e</code> | created edge |
Reimplemented in shower2.
Definition at line 532 of file graph.h.
View newest version in sPHENIX GitHub at line 532 of file graph.h
Referenced by new_edge().
|
inlinevirtual |
Virtual function called after a new node was created; can be redefined in a derived class for customization
<code>n</code> | created node |
Definition at line 458 of file graph.h.
View newest version in sPHENIX GitHub at line 458 of file graph.h
Referenced by new_node().
|
inlinevirtual |
Virtual function called after a edge was restored; can be redefined in a derived class for customization
<code>e</code> | restored edge |
Definition at line 587 of file graph.h.
View newest version in sPHENIX GitHub at line 587 of file graph.h
Referenced by restore_edge().
|
inlinevirtual |
Virtual function called after a node was restored; can be redefined in a derived class for customization
<code>n</code> | restored node |
Definition at line 511 of file graph.h.
View newest version in sPHENIX GitHub at line 511 of file graph.h
Referenced by restore_node().
|
inlinevirtual |
Virtual function called before performing clear; can be redefined in a derived class for customization. Please note: Although nodes and edges are deleted during graph::clear this is not achieved by calling graph::del_node and graph::del_edge, which is why the correspondig handler will not be called.
Reimplemented in shower2, shower2, shower2, Jetscape::PartonShower, and shower2.
Definition at line 601 of file graph.h.
View newest version in sPHENIX GitHub at line 601 of file graph.h
Referenced by clear().
|
inlinevirtual |
Virtual function called before a edge is deleted; can be redefined in a derived class for customization
<code>e</code> | edge to be deleted |
Definition at line 541 of file graph.h.
View newest version in sPHENIX GitHub at line 541 of file graph.h
Referenced by del_edge().
|
inlinevirtual |
Virtual function called before a node is deleted; can be redefined in a derived class for customization
<code>n</code> | node deleted afterwards |
Definition at line 467 of file graph.h.
View newest version in sPHENIX GitHub at line 467 of file graph.h
Referenced by del_node().
|
inlinevirtual |
Called before writing the graph key to os
. This can be used to write top-level keys that should appear before the graph in the file.
<code>os</code> | output stream. |
Definition at line 662 of file graph.h.
View newest version in sPHENIX GitHub at line 662 of file graph.h
Referenced by save().
|
inlinevirtual |
Virtual function called before a edge gets hidden; can be redefined in a derived class for customization
<code>e</code> | edge to be hidden |
Definition at line 560 of file graph.h.
View newest version in sPHENIX GitHub at line 560 of file graph.h
Referenced by hide_edge().
|
inlinevirtual |
Virtual function called before a node gets hidden; can be redefined in a derived class for customization
<code>n</code> | node to be hidden |
Definition at line 484 of file graph.h.
View newest version in sPHENIX GitHub at line 484 of file graph.h
Referenced by hide_node().
|
inlinevirtual |
Virtual function called before performing make_directed (only if graph was undirected) can be redefined in a derived class for customization
Definition at line 622 of file graph.h.
View newest version in sPHENIX GitHub at line 622 of file graph.h
Referenced by make_directed().
|
inlinevirtual |
Virtual function called before performing make_undirected; (only if graph was directed) can be redefined in a derived class for customization
Definition at line 640 of file graph.h.
View newest version in sPHENIX GitHub at line 640 of file graph.h
Referenced by make_undirected().
Virtual function called before a new edge is inserted; can be redefined in a derived class for customization
<code>s</code> | source of edge created afterwards |
<code>t</code> | target of edge created afterwards |
Definition at line 523 of file graph.h.
View newest version in sPHENIX GitHub at line 523 of file graph.h
Referenced by new_edge().
|
inlinevirtual |
Virtual function called before a new node is created; can be redefined in a derived class for customization
Definition at line 449 of file graph.h.
View newest version in sPHENIX GitHub at line 449 of file graph.h
Referenced by new_node().
|
inlinevirtual |
Virtual function called before a edge is restored; can be redefined in a derived class for customization
<code>e</code> | edge to be restored |
Definition at line 578 of file graph.h.
View newest version in sPHENIX GitHub at line 578 of file graph.h
Referenced by restore_edge().
|
inlinevirtual |
Virtual function called before a node is restored; can be redefined in a derived class for customization
<code>n</code> | node to be restored |
Definition at line 502 of file graph.h.
View newest version in sPHENIX GitHub at line 502 of file graph.h
Referenced by restore_node().
void graph::restore_edge | ( | edge | e | ) |
Restores a hidden edge
Precondition: e
is a valid edge in this graph
<code>e</code> | hidden edge |
Definition at line 566 of file graph.cpp.
View newest version in sPHENIX GitHub at line 566 of file graph.cpp
References edge_data::adj_pos, assert, edge::data, Acts::UnitConstants::e, edges, end, edge_data::hidden, hidden_edges, hidden_edges_count, edge::is_hidden(), it, edge_data::nodes, edge_data::owner, edge_data::pos, post_restore_edge_handler(), and pre_restore_edge_handler().
Referenced by maxflow_sap::augment(), maxflow_pp::comp_rem_net(), maxflow_ff::comp_single_flow(), biconnectivity::end_handler(), restore_graph(), and planarity::switch_to_component().
void graph::restore_graph | ( | ) |
Restores all hidden nodes and edges This means that, although the nodes and edges got hidden at different times, they will be restored all together.
Definition at line 701 of file graph.cpp.
View newest version in sPHENIX GitHub at line 701 of file graph.cpp
References end, hidden_edges, hidden_nodes, it, restore_edge(), restore_node(), and Acts::Test::tmp().
Referenced by maxflow_ff::restore_graph(), maxflow_sap::restore_graph(), maxflow_pp::restore_graph(), planarity::run(), and fm_partition::run().
void graph::restore_node | ( | node | n | ) |
Restores a hidden node. This only restores the node itself. It doesn't restore the incident edges, i.e. you will have to restore all the edges you get returned when calling graph::hide_node yourself.
Precondition: n
is a valid node in this graph
<code>n</code> | hidden node |
Definition at line 656 of file graph.cpp.
View newest version in sPHENIX GitHub at line 656 of file graph.cpp
References assert, node::data, node_data::hidden, hidden_nodes, hidden_nodes_count, node::is_hidden(), nodes, node_data::owner, node_data::pos, post_restore_node_handler(), and pre_restore_node_handler().
Referenced by maxflow_pp::comp_rem_net(), restore_graph(), and planarity::switch_to_component().
int graph::save | ( | const char * | filename | ) | const |
Save graph to file filename
in GML-format, i.e. graph [ node [ id # ] ... edge [ source # target #] ... ]
<code>filename</code> |
Definition at line 1073 of file graph.cpp.
View newest version in sPHENIX GitHub at line 1073 of file graph.cpp
References file.
Referenced by main(), and Jetscape::PartonShower::SaveAsGML().
void graph::save | ( | ostream * | file = &cout | ) | const |
Saves graph to stream file
in GML-format.
<code>file</code> | output stream defaults to cout. |
Definition at line 1043 of file graph.cpp.
View newest version in sPHENIX GitHub at line 1043 of file graph.cpp
References after_graph_save_handler(), directed, edges_begin(), edges_end(), end, it, nodes_begin(), nodes_end(), pre_graph_save_handler(), save_edge_info_handler(), save_graph_info_handler(), and save_node_info_handler().
|
inlinevirtual |
Called before the closing bracket of the list belonging to the key of edge e
is written. This can be used to write information belonging to the edge e
and thus should appear within the list associated with this edge.
<code>os</code> | output stream. |
Reimplemented in shower2, shower, Jetscape::PartonShower, shower2, shower, shower2, shower2, my_graph, and my_graph.
Definition at line 695 of file graph.h.
View newest version in sPHENIX GitHub at line 695 of file graph.h
Referenced by save().
|
inlinevirtual |
Called before the closing bracket of the list belonging to the graph key is written. This can be used to write information that belong to the graph, and thus should appear within the list associated with the graph key.
<code>os</code> | output stream. |
Definition at line 673 of file graph.h.
View newest version in sPHENIX GitHub at line 673 of file graph.h
Referenced by save().
|
inlinevirtual |
Called before the closing bracket of the list belonging to the key of node n
is written. This can be used to write information belonging to the node n
and thus should appear within the list associated with this node.
<code>os</code> | output stream. |
Reimplemented in Jetscape::PartonShower, shower2, shower2, shower2, my_graph, and my_graph.
Definition at line 684 of file graph.h.
View newest version in sPHENIX GitHub at line 684 of file graph.h
Referenced by save().
|
virtual |
Called after the graph is completely built. The topmost list of key-value-pairs is passed to this handler. NB: This list also contains the graph key, which was used to build the graph.
<code>list</code> | pointer to the list of key-value pairs at top level |
Definition at line 1039 of file graph.cpp.
View newest version in sPHENIX GitHub at line 1039 of file graph.cpp
Referenced by load().
|
friend |
|
mutableprivate |
Definition at line 756 of file graph.h.
View newest version in sPHENIX GitHub at line 756 of file graph.h
Referenced by is_connected(), is_directed(), is_undirected(), load(), make_directed(), make_undirected(), and save().
|
private |
Definition at line 761 of file graph.h.
View newest version in sPHENIX GitHub at line 761 of file graph.h
Referenced by all_edges(), clear(), del_all_edges(), del_all_nodes(), del_edge(), edges_begin(), edges_end(), hide_edge(), new_edge(), and restore_edge().
|
private |
Definition at line 762 of file graph.h.
View newest version in sPHENIX GitHub at line 762 of file graph.h
Referenced by clear(), del_all_edges(), del_all_nodes(), del_edge(), new_edge(), new_edge_id(), number_of_edges(), and number_of_ids().
|
private |
Definition at line 794 of file graph.h.
View newest version in sPHENIX GitHub at line 794 of file graph.h
Referenced by clear(), del_edge(), and new_edge_id().
|
private |
Definition at line 795 of file graph.h.
View newest version in sPHENIX GitHub at line 795 of file graph.h
Referenced by clear(), del_edge(), new_edge_id(), and number_of_ids().
|
private |
Definition at line 793 of file graph.h.
View newest version in sPHENIX GitHub at line 793 of file graph.h
Referenced by clear(), del_node(), and new_node_id().
|
private |
Definition at line 795 of file graph.h.
View newest version in sPHENIX GitHub at line 795 of file graph.h
Referenced by clear(), del_node(), load(), new_node_id(), and number_of_ids().
|
private |
Definition at line 767 of file graph.h.
View newest version in sPHENIX GitHub at line 767 of file graph.h
Referenced by clear(), del_node(), hide_edge(), restore_edge(), and restore_graph().
|
private |
Definition at line 768 of file graph.h.
View newest version in sPHENIX GitHub at line 768 of file graph.h
Referenced by clear(), hide_edge(), number_of_edges(), and restore_edge().
|
private |
Definition at line 766 of file graph.h.
View newest version in sPHENIX GitHub at line 766 of file graph.h
Referenced by clear(), hide_node(), restore_graph(), and restore_node().
|
private |
Definition at line 768 of file graph.h.
View newest version in sPHENIX GitHub at line 768 of file graph.h
Referenced by clear(), hide_node(), number_of_nodes(), and restore_node().
|
private |
Definition at line 760 of file graph.h.
View newest version in sPHENIX GitHub at line 760 of file graph.h
Referenced by all_nodes(), choose_node(), clear(), del_all_edges(), del_all_nodes(), del_node(), graph(), hide_node(), induced_subgraph(), new_node(), nodes_begin(), nodes_end(), and restore_node().
|
private |
Definition at line 762 of file graph.h.
View newest version in sPHENIX GitHub at line 762 of file graph.h
Referenced by clear(), del_all_nodes(), del_node(), new_node(), new_node_id(), number_of_ids(), and number_of_nodes().