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
35namespace abacus {
36
37
39
57class TailOff : public AbacusRoot {
58 friend class Sub;
59public:
60
62
65 TailOff(Master *master) : master_(master)
66 {
67 if (master->tailOffNLp() > 0)
68 lpHistory_ = new AbaRing<double>(master->tailOffNLp());
69 else
70 lpHistory_ = nullptr;
71 }
72
74
78 TailOff(Master *master, int NLp) : master_(master)
79 {
80 if (NLp > 0)
82 else
83 lpHistory_ = nullptr;
84 }
85
87 ~TailOff() { delete lpHistory_; }
88
89
91
99 friend std::ostream &operator<<(std::ostream &out, const TailOff &rhs);
100
102
109 virtual bool tailOff() const;
110
112
124 int diff(int nLps, double &d) const;
125
126protected:
127
129
136 void update(double value) {
137 if (lpHistory_)
138 lpHistory_->insert(value);
139 }
140
141
143
151 void reset() {
152 if (lpHistory_)
153 lpHistory_->clear();
154 }
155
156
159
162};
163
164}
Bounded circular lists.
Definition ring.h:51
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:68
The master of the optimization.
Definition master.h:69
int tailOffNLp() const
Returns the number of linear programs considered in the tailing off analysis.
Definition master.h:646
The subproblem.
Definition sub.h:68
Tailing off manager.
Definition tailoff.h:57
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:78
TailOff(Master *master)
The constructor takes the length of the tailing off history from Master::tailOffNLp().
Definition tailoff.h:65
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:158
~TailOff()
The destructor.
Definition tailoff.h:87
void reset()
Clears the solution history.
Definition tailoff.h:151
AbaRing< double > * lpHistory_
The LP-values considered in the tailing off analysis.
Definition tailoff.h:161
void update(double value)
A new LP-solution value can be stored by calling the function update().
Definition tailoff.h:136
the master of the optimization.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
ring.