class CollectingModeSolverHeap More...
#include <bbParaSolverPool.h>
Public Types | |
enum | ResultOfInsert { SUCCEEDED , FAILED_BY_FULL } |
results of insert More... | |
Public Member Functions | |
CollectingModeSolverHeap (std::size_t size) | |
constructor More... | |
virtual | ~CollectingModeSolverHeap () |
destructor More... | |
ResultOfInsert | insert (BbParaSolverPoolElementPtr solver) |
insert BbParaSolverPoolElementPtr to CollectingModeSolver Heap More... | |
BbParaSolverPoolElementPtr | top () const |
obtain top priority BbParaSolverPoolElementPtr More... | |
BbParaSolverPoolElementPtr | remove () |
remove top priority BbParaSolverPoolElementPtr from CollectingModeSolver Heap */ More... | |
void | resize (std::size_t size) |
resize CollectingModeSolver Heap More... | |
std::size_t | getHeapSize () const |
get current used heap size More... | |
std::size_t | getMaxHeapSize () const |
get max heap size More... | |
virtual void | updateDualBoundValue (BbParaSolverPoolElementPtr solver, double value)=0 |
update CollectingModeSolver heap by a new dual bound value of this Solver More... | |
virtual void | deleteElement (BbParaSolverPoolElementPtr solver)=0 |
delete BbParaSolverPoolElementPtr from CollectingModeSolver Heap More... | |
virtual void | upHeap (std::size_t pos)=0 |
up heap More... | |
virtual void | downHeap (std::size_t pos)=0 |
down heap More... | |
const std::string | toString () |
stringfy of this object for debugging More... | |
Protected Attributes | |
std::size_t | maxHeapSize |
maximum size of this heap More... | |
std::size_t | heapSize |
current used heap size More... | |
BbParaSolverPoolElementPtr * | heap |
heap : contents are BbParaSolverPoolElementPtr More... | |
class CollectingModeSolverHeap
Definition at line 1109 of file bbParaSolverPool.h.
enum ResultOfInsert |
results of insert
Enumerator | |
---|---|
SUCCEEDED | SUCCEEDED. |
FAILED_BY_FULL | FAILED_BY_FULL. |
Definition at line 1117 of file bbParaSolverPool.h.
CollectingModeSolverHeap | ( | std::size_t | size | ) |
constructor
constructor of selection heap
size | heap size |
Definition at line 357 of file bbParaSolverPool.cpp.
References CollectingModeSolverHeap::heap, CollectingModeSolverHeap::heapSize, and CollectingModeSolverHeap::maxHeapSize.
|
virtual |
destructor
destructor of selection heap
Definition at line 367 of file bbParaSolverPool.cpp.
References CollectingModeSolverHeap::heap.
|
pure virtual |
delete BbParaSolverPoolElementPtr from CollectingModeSolver Heap
solver | Solver pool element to be deleted |
Implemented in DescendingCollectingModeSolverHeap, and AscendingCollectingModeSolverHeap.
Referenced by BbParaSolverPool::enforcedSwitchOutCollectingMode(), BbParaSolverPool::inactivateSolver(), BbParaSolverPool::resetCountersInSolver(), BbParaSolverPool::sendSwitchOutCollectingModeIfNecessary(), and BbParaSolverPool::solverDied().
|
pure virtual |
down heap
pos | start position to down heap |
Implemented in DescendingCollectingModeSolverHeap, and AscendingCollectingModeSolverHeap.
Referenced by CollectingModeSolverHeap::remove().
std::size_t getHeapSize | ( | ) | const |
get current used heap size
Definition at line 1174 of file bbParaSolverPool.h.
References CollectingModeSolverHeap::heapSize.
Referenced by BbParaSolverPoolForMinimization::updateSolverStatus().
std::size_t getMaxHeapSize | ( | ) | const |
get max heap size
Definition at line 1184 of file bbParaSolverPool.h.
References CollectingModeSolverHeap::maxHeapSize.
CollectingModeSolverHeap::ResultOfInsert insert | ( | BbParaSolverPoolElementPtr | inSolver | ) |
insert BbParaSolverPoolElementPtr to CollectingModeSolver Heap
insert BbParaSolverPoolElementPtr to selection heap
inSolver | Solver pool element to be inserted |
Definition at line 388 of file bbParaSolverPool.cpp.
References CollectingModeSolverHeap::FAILED_BY_FULL, CollectingModeSolverHeap::heap, CollectingModeSolverHeap::heapSize, CollectingModeSolverHeap::maxHeapSize, CollectingModeSolverHeap::SUCCEEDED, and CollectingModeSolverHeap::upHeap().
Referenced by BbParaSolverPoolForMinimization::switchInCollectingMode(), BbParaSolverPool::switchInCollectingToSolver(), and BbParaSolverPoolForMinimization::updateSolverStatus().
BbParaSolverPoolElementPtr remove | ( | ) |
remove top priority BbParaSolverPoolElementPtr from CollectingModeSolver Heap */
remove the top priority element form selection heap
Definition at line 400 of file bbParaSolverPool.cpp.
References CollectingModeSolverHeap::downHeap(), CollectingModeSolverHeap::heap, CollectingModeSolverHeap::heapSize, and BbParaSolverPoolElement::setCollectingModeSolverHeapElement().
void resize | ( | std::size_t | size | ) |
resize CollectingModeSolver Heap
resize selection heap
size | new size |
Definition at line 374 of file bbParaSolverPool.cpp.
References CollectingModeSolverHeap::heap, and CollectingModeSolverHeap::maxHeapSize.
BbParaSolverPoolElementPtr top | ( | ) | const |
obtain top priority BbParaSolverPoolElementPtr
Definition at line 1150 of file bbParaSolverPool.h.
References CollectingModeSolverHeap::heap.
Referenced by BbParaSolverPoolForMinimization::updateSolverStatus().
const std::string toString | ( | ) |
stringfy of this object for debugging
stringfy selection heap
Definition at line 419 of file bbParaSolverPool.cpp.
References BbParaSolverPoolElement::getNumOfDiffNodesLeft(), BbParaSolverPoolElement::getNumOfNodesLeft(), BbParaSolverPoolElement::getRank(), BbParaSolverPoolElement::getStatus(), CollectingModeSolverHeap::heap, CollectingModeSolverHeap::heapSize, BbParaSolverPoolElement::isInCollectingMode(), and CollectingModeSolverHeap::maxHeapSize.
Referenced by BbParaSolverPoolForMinimization::updateSolverStatus().
|
pure virtual |
update CollectingModeSolver heap by a new dual bound value of this Solver
solver | Solver pool element to be updated |
value | dual bound value |
Implemented in DescendingCollectingModeSolverHeap, and AscendingCollectingModeSolverHeap.
Referenced by BbParaSolverPoolForMinimization::updateSolverStatus().
|
pure virtual |
up heap
pos | start position to up heap |
Implemented in DescendingCollectingModeSolverHeap, and AscendingCollectingModeSolverHeap.
Referenced by CollectingModeSolverHeap::insert().
|
protected |
heap : contents are BbParaSolverPoolElementPtr
Definition at line 1233 of file bbParaSolverPool.h.
Referenced by CollectingModeSolverHeap::CollectingModeSolverHeap(), DescendingCollectingModeSolverHeap::deleteElement(), AscendingCollectingModeSolverHeap::deleteElement(), DescendingCollectingModeSolverHeap::downHeap(), AscendingCollectingModeSolverHeap::downHeap(), CollectingModeSolverHeap::insert(), CollectingModeSolverHeap::remove(), CollectingModeSolverHeap::resize(), CollectingModeSolverHeap::top(), CollectingModeSolverHeap::toString(), DescendingCollectingModeSolverHeap::updateDualBoundValue(), AscendingCollectingModeSolverHeap::updateDualBoundValue(), DescendingCollectingModeSolverHeap::upHeap(), AscendingCollectingModeSolverHeap::upHeap(), and CollectingModeSolverHeap::~CollectingModeSolverHeap().
|
protected |
current used heap size
Definition at line 1231 of file bbParaSolverPool.h.
Referenced by CollectingModeSolverHeap::CollectingModeSolverHeap(), DescendingCollectingModeSolverHeap::deleteElement(), AscendingCollectingModeSolverHeap::deleteElement(), DescendingCollectingModeSolverHeap::downHeap(), AscendingCollectingModeSolverHeap::downHeap(), CollectingModeSolverHeap::getHeapSize(), CollectingModeSolverHeap::insert(), CollectingModeSolverHeap::remove(), and CollectingModeSolverHeap::toString().
|
protected |
maximum size of this heap
Definition at line 1230 of file bbParaSolverPool.h.
Referenced by CollectingModeSolverHeap::CollectingModeSolverHeap(), CollectingModeSolverHeap::getMaxHeapSize(), CollectingModeSolverHeap::insert(), CollectingModeSolverHeap::resize(), and CollectingModeSolverHeap::toString().