Empirical
|
#include <SolveState.h>
Public Member Functions | |
SolveState (size_t state_size=0) | |
SolveState (const SolveState &in) | |
~SolveState () | |
SolveState & | operator= (const SolveState &in) |
Set this SolveState to be identical to another. More... | |
size_t | GetSize () const |
How many items are being considered in the current SolveState? More... | |
bool | IsIn (size_t id) const |
bool | IsUnk (size_t id) const |
bool | IsOut (size_t id) const |
bool | IsFinal () const |
Test if all items have been decided upon (none are still in the "unknown" state) More... | |
size_t | CountIn () const |
How many items have been included for sure? More... | |
size_t | CountUnk () const |
How many items have yet to be decided upon (are "unknown") More... | |
size_t | CountOut () const |
How many items have been excluded for sure. More... | |
const BitVector & | GetInVector () const |
Get the BitVector associated with which items have been included for sure. More... | |
const BitVector & | GetUnkVector () const |
Get the BitVector associated with which items have yet to be decided upon. More... | |
BitVector | GetOutVector () const |
Get the BitVector associated with which iterm have been excluded for sure. More... | |
int | GetNextUnk (size_t prev_unk) const |
Get the ID of the next unknown item. More... | |
void | Include (size_t id) |
Mark a specific item as to be included. More... | |
void | Exclude (size_t id) |
Mark a specific item as to be excluded. More... | |
void | ForceExclude (size_t id) |
void | IncludeSet (const BitVector &inc_set) |
Include ALL of the items specified in the provided BitVector. More... | |
void | ExcludeSet (const BitVector &inc_set) |
Exclude ALL of the items specified in the provided BitVector. More... | |
Often in a branch-and-bound algorithm, we need to identify the sub-set of items that maximizes (or minimizes) an optimization metric. SolveState keeps track of the current state for which items have been locked in as "included" in the current branks, which have been "excluded", and which are still "unknown" (still to be decided upon.) All tracking is performed with BitVectors for high efficiency.
|
inline |
|
inline |
|
inline |
|
inline |
How many items have been included for sure?
|
inline |
How many items have been excluded for sure.
|
inline |
How many items have yet to be decided upon (are "unknown")
|
inline |
Mark a specific item as to be excluded.
|
inline |
Exclude ALL of the items specified in the provided BitVector.
|
inline |
Change our mind about a potentially included node (Be careful since many algorithms don't requite this type of changes to be made.)
|
inline |
Get the BitVector associated with which items have been included for sure.
|
inline |
Get the ID of the next unknown item.
|
inline |
Get the BitVector associated with which iterm have been excluded for sure.
|
inline |
How many items are being considered in the current SolveState?
|
inline |
Get the BitVector associated with which items have yet to be decided upon.
|
inline |
Mark a specific item as to be included.
|
inline |
Include ALL of the items specified in the provided BitVector.
|
inline |
Test if all items have been decided upon (none are still in the "unknown" state)
|
inline |
Test if a particular item is going to be included for sure in the current solve state. (If it has been excluded -OR- is yet to be decided upon, false will be returned)
|
inline |
Test if a particular item is going to be excluded for sure in the current solve state. (If it has been included -OR- is yet to be decided upon, false will be returned)
|
inline |
Test if a particular item is yet to be decided upon in the current solve state. (If it has been excluded -OR- is included for sure, false will be returned)
|
inline |
Set this SolveState to be identical to another.