ABA_DUALBOUND Class Reference

class ABA_DUALBOUND implements the abstract datatype for holding up to $n$ dual bounds $\{d_1,\dots,d_n\}$. A dual bound $d_i$ can be inserted or removed. More...

#include <dualbound.h>

List of all members.

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_GLOBALglob_
ABA_INTSET set_
double * bounds_
double best_
int bestIndex_
double worst_
bool minIsBest_


Detailed Description

class ABA_DUALBOUND implements the abstract datatype for holding up to $n$ dual bounds $\{d_1,\dots,d_n\}$. A dual bound $d_i$ can be inserted or removed.

Definition at line 38 of file dualbound.h.


Constructor & Destructor Documentation

ABA_DUALBOUND::ABA_DUALBOUND ( ABA_GLOBAL glob  ) 

The constructor.

Parameters:
glob A pointer to the corresponding global object.

ABA_DUALBOUND::~ABA_DUALBOUND (  ) 

The destructor deletes the allocated memory.


Member Function Documentation

void ABA_DUALBOUND::initialize ( int  n,
bool  minIsBest 
)

This function initializes the set of dual bounds.

Parameters:
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.

Parameters:
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.

Parameters:
i The index of the dual bound (0..n-1).

bool ABA_DUALBOUND::better ( int  i,
double  d 
) const

Parameters:
i The index of the dual bound (0..n-1).
d The value of the dual bound to be tested.
Returns:
true if d is a new dual bound or d is better than the previous dual bound at index i|,}

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.

Parameters:
index An pointer to an integer to which the index of the best dual bound should be stored. This is an optional parameter.
Returns:
The best dual bound.

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.

Parameters:
d An additional dual bound.
Returns:
The best dual bound.

double ABA_DUALBOUND::worst (  )  const [inline]

Returns the worst dual bound (minimum or maximum) of all dual bounds in the set.

Returns:
The worst dual bound.

Definition at line 131 of file dualbound.h.

void ABA_DUALBOUND::updateBestAndWorst (  )  [private]

Updates the variables best_|, worst_ and bestIndex_.


Member Data Documentation

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.


The documentation for this class was generated from the following file:
Generated on Tue Aug 14 18:09:56 2007 for ABACUS by  doxygen 1.5.1