Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

Full2ComponentGenerator.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 
36 namespace ogdf {
37 namespace steiner_tree {
38 
45 template<typename T>
47 {
48 public:
50  inline void call(
51  const EdgeWeightedGraph<T> &G,
52  const List<node> &terminals,
53  const NodeArray<NodeArray<T>> &distance,
54  const NodeArray<NodeArray<edge>> &pred,
55  std::function<void(node, node, T)> generateFunction) const
56  {
57  for (ListConstIterator<node> it_u = terminals.begin(); it_u.valid(); ++it_u) {
58  const node u = *it_u;
59  for (ListConstIterator<node> it_v = it_u.succ(); it_v.valid(); ++it_v) {
60  const node v = *it_v;
61  if (pred[u][v]) {
62  generateFunction(u, v, distance[u][v]);
63  }
64  }
65  }
66  }
67 };
68 
69 }
70 }
ListIteratorBase< E, isConst, isReverse > succ() const
Returns successor iterator.
Definition: List.h:145
void call(const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< NodeArray< T >> &distance, const NodeArray< NodeArray< edge >> &pred, std::function< void(node, node, T)> generateFunction) const
Generate full 2-components and call generateFunction for each full 2-component.
iterator begin()
Returns an iterator to the first element of the list.
Definition: List.h:352
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:438
Doubly linked lists (maintaining the length of the list).
Definition: List.h:40
Declaration of class EdgeWeightedGraph.
Class for the representation of nodes.
Definition: Graph_d.h:169
Encapsulates a pointer to a list element.
Definition: List.h:42
The namespace for all OGDF objects.
Trivial full 2-component generation by lookups of shortest paths between terminal pairs...