dual bounds
. A dual bound
can be inserted or removed.
More...
#include <dualbound.h>
Public Member Functions | |
| ABA_DUALBOUND (ABA_GLOBAL *glob) | |
| ~ABA_DUALBOUND () | |
| The destructor deletes the allocated memory. | |
| void | initialize (int n, bool minIsBest) |
| void | insert (int i, double d) |
| void | remove (int i) |
| bool | better (int i, double d) const |
| double | best (int *index=0) const |
| double | best (double d) const |
| This version of the function best() returns the best dual bound (minimum or maximum) of all dual bounds in the set and a specified dual bound. | |
| double | worst () const |
Private Member Functions | |
| void | updateBestAndWorst () |
Private Attributes | |
| ABA_GLOBAL * | glob_ |
| ABA_INTSET | set_ |
| double * | bounds_ |
| double | best_ |
| int | bestIndex_ |
| double | worst_ |
| bool | minIsBest_ |
dual bounds
. A dual bound
can be inserted or removed.
Definition at line 38 of file dualbound.h.
| ABA_DUALBOUND::ABA_DUALBOUND | ( | ABA_GLOBAL * | glob | ) |
The constructor.
| glob | A pointer to the corresponding global object. |
| ABA_DUALBOUND::~ABA_DUALBOUND | ( | ) |
The destructor deletes the allocated memory.
| void ABA_DUALBOUND::initialize | ( | int | n, | |
| bool | minIsBest | |||
| ) |
This function initializes the set of dual bounds.
| n | The object can hold up to n dual bounds. | |
| minIsBest | If this parameter is true the function best() returns the minimum of the dual bounds, otherwise it returns the maximum. |
| void ABA_DUALBOUND::insert | ( | int | i, | |
| double | d | |||
| ) |
Inserts a dual bound in the set.
If a bound with the same index already exists in the set the value of the bound is updated.
| i | The index of the dual bound (0..n-1). | |
| d | The dual bound. |
| void ABA_DUALBOUND::remove | ( | int | i | ) |
Removes a dual bound from the set.
| i | The index of the dual bound (0..n-1). |
| bool ABA_DUALBOUND::better | ( | int | i, | |
| double | d | |||
| ) | const |
| i | The index of the dual bound (0..n-1). | |
| d | The value of the dual bound to be tested. |
false otherwise.
| double ABA_DUALBOUND::best | ( | int * | index = 0 |
) | const [inline] |
Returns the best dual bound (minimum or maximum) of all dual bounds in the set.
| index | An pointer to an integer to which the index of the best dual bound should be stored. This is an optional parameter. |
Definition at line 124 of file dualbound.h.
| double ABA_DUALBOUND::best | ( | double | d | ) | const |
This version of the function best() returns the best dual bound (minimum or maximum) of all dual bounds in the set and a specified dual bound.
| d | An additional dual bound. |
| double ABA_DUALBOUND::worst | ( | ) | const [inline] |
Returns the worst dual bound (minimum or maximum) of all dual bounds in the set.
Definition at line 131 of file dualbound.h.
| void ABA_DUALBOUND::updateBestAndWorst | ( | ) | [private] |
Updates the variables best_|, worst_ and bestIndex_.
ABA_GLOBAL* ABA_DUALBOUND::glob_ [private] |
Definition at line 115 of file dualbound.h.
ABA_INTSET ABA_DUALBOUND::set_ [private] |
Definition at line 116 of file dualbound.h.
double* ABA_DUALBOUND::bounds_ [private] |
Definition at line 117 of file dualbound.h.
double ABA_DUALBOUND::best_ [private] |
Definition at line 118 of file dualbound.h.
int ABA_DUALBOUND::bestIndex_ [private] |
Definition at line 119 of file dualbound.h.
double ABA_DUALBOUND::worst_ [private] |
Definition at line 120 of file dualbound.h.
bool ABA_DUALBOUND::minIsBest_ [private] |
Definition at line 121 of file dualbound.h.
1.5.1