Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

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 }
node m_s2
terminal nodes
Definition: Triple.h:107
double win() const
Definition: Triple.h:76
double m_win
the win of the triple at some point of time (used as cache)
Definition: Triple.h:110
void win(double w)
Definition: Triple.h:101
node m_z
center node of the triple
Definition: Triple.h:108
T m_cost
edge costs of the triple in the original graph
Definition: Triple.h:109
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
Class for the representation of nodes.
Definition: Graph_d.h:169
Includes declaration of graph class.
The namespace for all OGDF objects.
This class represents a triple used by various contraction-based minimum Steiner tree approximations...
Definition: Triple.h:44