Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

Triple.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include <ogdf/basic/Graph.h>
36 
37 namespace ogdf {
38 namespace steiner_tree {
39 
43 template<typename T>
44 class Triple {
45 public:
46  explicit Triple(const node s0 = nullptr, const node s1 = nullptr, const node s2 = nullptr, const node z = nullptr, T cost = 0, double win = 0)
47  : m_s0(s0)
48  , m_s1(s1)
49  , m_s2(s2)
50  , m_z(z)
51  , m_cost(cost)
52  , m_win(win)
53  {
54  }
55 
56  node s0() const
57  {
58  return m_s0;
59  }
60  node s1() const
61  {
62  return m_s1;
63  }
64  node s2() const
65  {
66  return m_s2;
67  }
68  node z() const
69  {
70  return m_z;
71  }
72  T cost() const
73  {
74  return m_cost;
75  }
76  double win() const
77  {
78  return m_win;
79  }
80 
81  void s0(node u)
82  {
83  m_s0 = u;
84  }
85  void s1(node u)
86  {
87  m_s1 = u;
88  }
89  void s2(node u)
90  {
91  m_s2 = u;
92  }
93  void z(node u)
94  {
95  m_z = u;
96  }
97  void cost(T c)
98  {
99  m_cost = c;
100  }
101  void win(double w)
102  {
103  m_win = w;
104  }
105 
106 private:
109  T m_cost;
110  double m_win;
111 };
112 
113 }
114 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::steiner_tree::Triple::win
double win() const
Definition: Triple.h:76
Graph.h
Includes declaration of graph class.
ogdf::steiner_tree::Triple::s2
void s2(node u)
Definition: Triple.h:89
ogdf::steiner_tree::Triple
This class represents a triple used by various contraction-based minimum Steiner tree approximations.
Definition: Triple.h:44
ogdf::steiner_tree::Triple::s2
node s2() const
Definition: Triple.h:64
ogdf::steiner_tree::Triple::Triple
Triple(const node s0=nullptr, const node s1=nullptr, const node s2=nullptr, const node z=nullptr, T cost=0, double win=0)
Definition: Triple.h:46
ogdf::steiner_tree::Triple::s1
node s1() const
Definition: Triple.h:60
ogdf::steiner_tree::Triple::m_s2
node m_s2
terminal nodes
Definition: Triple.h:107
ogdf::steiner_tree::Triple::s1
void s1(node u)
Definition: Triple.h:85
ogdf::steiner_tree::Triple::z
void z(node u)
Definition: Triple.h:93
ogdf::steiner_tree::Triple::cost
void cost(T c)
Definition: Triple.h:97
ogdf::steiner_tree::Triple::win
void win(double w)
Definition: Triple.h:101
ogdf::steiner_tree::Triple::m_s0
node m_s0
Definition: Triple.h:107
ogdf::steiner_tree::Triple::m_win
double m_win
the win of the triple at some point of time (used as cache)
Definition: Triple.h:110
ogdf::steiner_tree::Triple::m_z
node m_z
center node of the triple
Definition: Triple.h:108
ogdf::steiner_tree::Triple::s0
node s0() const
Definition: Triple.h:56
ogdf::steiner_tree::Triple::cost
T cost() const
Definition: Triple.h:72
ogdf::steiner_tree::Triple::s0
void s0(node u)
Definition: Triple.h:81
ogdf::steiner_tree::Triple::m_s1
node m_s1
Definition: Triple.h:107
ogdf::steiner_tree::Triple::m_cost
T m_cost
edge costs of the triple in the original graph
Definition: Triple.h:109
ogdf::steiner_tree::Triple::z
node z() const
Definition: Triple.h:68
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:169