Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
tailoff.h
Go to the documentation of this file.
1
30#pragma once
31
34
35#pragma GCC visibility push(default)
36namespace abacus {
37
38
40
58class TailOff : public AbacusRoot {
59 friend class Sub;
60public:
61
63
66 TailOff(Master *master) : master_(master)
67 {
68 if (master->tailOffNLp() > 0)
69 lpHistory_ = new AbaRing<double>(master->tailOffNLp());
70 else
71 lpHistory_ = nullptr;
72 }
73
75
79 TailOff(Master *master, int NLp) : master_(master)
80 {
81 if (NLp > 0)
82 lpHistory_ = new AbaRing<double>(NLp);
83 else
84 lpHistory_ = nullptr;
85 }
86
88 ~TailOff() { delete lpHistory_; }
89
90
92
100 friend std::ostream &operator<<(std::ostream &out, const TailOff &rhs);
101
103
110 virtual bool tailOff() const;
111
113
125 int diff(int nLps, double &d) const;
126
127protected:
128
130
137 void update(double value) {
138 if (lpHistory_)
139 lpHistory_->insert(value);
140 }
141
142
144
152 void reset() {
153 if (lpHistory_)
154 lpHistory_->clear();
155 }
156
157
160
163};
164
165}
166#pragma GCC visibility pop
Bounded circular lists.
Definition ring.h:52
void clear()
Empties the ring.
void insert(Type elem)
Inserts a new element into the ring.
Base class of all other classes of ABACUS.
Definition abacusroot.h:69
The master of the optimization.
Definition master.h:70
int tailOffNLp() const
Returns the number of linear programs considered in the tailing off analysis.
Definition master.h:647
The subproblem.
Definition sub.h:69
Tailing off manager.
Definition tailoff.h:58
virtual bool tailOff() const
Checks whether there is a tailing-off effect.
int diff(int nLps, double &d) const
Can be used to retrieve the difference between the last and a previous LP-solution in percent.
TailOff(Master *master, int NLp)
An alternative constructor takes the length of the tailing off history from the parameter NLp.
Definition tailoff.h:79
TailOff(Master *master)
The constructor takes the length of the tailing off history from Master::tailOffNLp().
Definition tailoff.h:66
friend std::ostream & operator<<(std::ostream &out, const TailOff &rhs)
The output operator.
Master * master_
A pointer to the corresponding master of the optimization.
Definition tailoff.h:159
~TailOff()
The destructor.
Definition tailoff.h:88
void reset()
Clears the solution history.
Definition tailoff.h:152
AbaRing< double > * lpHistory_
The LP-values considered in the tailing off analysis.
Definition tailoff.h:162
void update(double value)
A new LP-solution value can be stored by calling the function update().
Definition tailoff.h:137
the master of the optimization.
ring.