Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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 
57  {
58  }
59 
60  node s0() const
61  {
62  return m_s0;
63  }
64  node s1() const
65  {
66  return m_s1;
67  }
68  node s2() const
69  {
70  return m_s2;
71  }
72  node z() const
73  {
74  return m_z;
75  }
76  T cost() const
77  {
78  return m_cost;
79  }
80  double win() const
81  {
82  return m_win;
83  }
84 
85  void s0(node u)
86  {
87  m_s0 = u;
88  }
89  void s1(node u)
90  {
91  m_s1 = u;
92  }
93  void s2(node u)
94  {
95  m_s2 = u;
96  }
97  void z(node u)
98  {
99  m_z = u;
100  }
101  void cost(T c)
102  {
103  m_cost = c;
104  }
105  void win(double w)
106  {
107  m_win = w;
108  }
109 
110 private:
113  T m_cost;
114  double m_win;
115 };
116 
117 } // end namespace steiner_tree
118 } // end namespace ogdf
node m_s2
terminal nodes
Definition: Triple.h:111
double win() const
Definition: Triple.h:80
double m_win
the win of the triple at some point of time (used as cache)
Definition: Triple.h:114
void win(double w)
Definition: Triple.h:105
node m_z
center node of the triple
Definition: Triple.h:112
T m_cost
edge costs of the triple in the original graph
Definition: Triple.h:113
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:167
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