Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

abacus::History Class Reference

Solution histories. More...

#include <ogdf/lib/abacus/history.h>

+ Inheritance diagram for abacus::History:

Public Member Functions

 History (Master *master)
 Creates a history table with 100 possible entries. More...
 
virtual ~History ()
 
void update ()
 Adds an additional line to the history table. More...
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor. More...
 

Private Member Functions

void realloc ()
 The function realloc() enlarges the history table by 100 components. More...
 
int size () const
 Returns the length of the history table. More...
 

Private Attributes

Array< double > dualBound_
 The array storing the value of the best dual solution. More...
 
Mastermaster_
 A pointer to corresponding master of the optimization. More...
 
int n_
 The number of entries in the history table. More...
 
Array< double > primalBound_
 The array storing the value of the best primal solution. More...
 
Array< int64_t > time_
 The CPU time in seconds, when the entry in the table was made. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const History &rhs)
 The output operator. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from abacus::AbacusRoot
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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ 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
masterA pointer to the corresponding master of the optimization.

Definition at line 52 of file history.h.

◆ ~History()

virtual abacus::History::~History ( )
inlinevirtual

Definition at line 60 of file history.h.

Member Function Documentation

◆ 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.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const History rhs 
)
friend

The output operator.

Parameters
outThe output stream.
rhsThe solution history being output.
Returns
A reference to the output stream.

Member Data Documentation

◆ 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_

int abacus::History::n_
private

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: