Solution histories.
More...
#include <ogdf/lib/abacus/history.h>
|
static bool | ascii2bool (const string &str) |
| Converts the string str to a boolean value. More...
|
|
static bool | endsWith (const string &str, const string &end) |
| Returns true if str ends with end, false otherwise. More...
|
|
static double | fracPart (double x) |
| Returns the absolute value of the fractional part of x. More...
|
|
static const char * | onOff (bool value) |
| Converts a boolean variable to the strings "on" and "off". More...
|
|
Solution histories.
This class implements the storage of the solution history. Each time when a better feasible solution or globally valid dual bound is found, it should be memorized in this class.
Definition at line 43 of file history.h.
◆ History()
abacus::History::History |
( |
Master * |
master | ) |
|
|
inline |
Creates a history table with 100 possible entries.
If this number is exceeded an automatic reallocation is performed.
- Parameters
-
master | A pointer to the corresponding master of the optimization. |
Definition at line 52 of file history.h.
◆ ~History()
virtual abacus::History::~History |
( |
| ) |
|
|
inlinevirtual |
◆ realloc()
void abacus::History::realloc |
( |
| ) |
|
|
private |
The function realloc() enlarges the history table by 100 components.
◆ size()
int abacus::History::size |
( |
| ) |
const |
|
inlineprivate |
Returns the length of the history table.
Definition at line 86 of file history.h.
◆ update()
void abacus::History::update |
( |
| ) |
|
Adds an additional line to the history table.
Primal bound, dual bound, and the time are taken from the corresponding master object. The history table is automatically reallocated if necessary.
Usually an explicit call to this function from an application class is not required since update() is automatically called if a new global primal or dual bound is found.
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const History & |
rhs |
|
) |
| |
|
friend |
The output operator.
- Parameters
-
out | The output stream. |
rhs | The solution history being output. |
- Returns
- A reference to the output stream.
◆ dualBound_
Array<double> abacus::History::dualBound_ |
|
private |
The array storing the value of the best dual solution.
Definition at line 99 of file history.h.
◆ master_
Master* abacus::History::master_ |
|
private |
A pointer to corresponding master of the optimization.
Definition at line 93 of file history.h.
◆ n_
The number of entries in the history table.
Definition at line 105 of file history.h.
◆ primalBound_
Array<double> abacus::History::primalBound_ |
|
private |
The array storing the value of the best primal solution.
Definition at line 96 of file history.h.
◆ time_
Array<int64_t> abacus::History::time_ |
|
private |
The CPU time in seconds, when the entry in the table was made.
Definition at line 102 of file history.h.
The documentation for this class was generated from the following file: