Scippy

UG

Ubiquity Generator framework

CollectingModeSolverHeap Class Referenceabstract

class CollectingModeSolverHeap More...

#include <bbParaSolverPool.h>

Inheritance diagram for CollectingModeSolverHeap:
AscendingCollectingModeSolverHeap DescendingCollectingModeSolverHeap

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...
 
BbParaSolverPoolElementPtrheap
 heap : contents are BbParaSolverPoolElementPtr More...
 

Detailed Description

class CollectingModeSolverHeap

Definition at line 1109 of file bbParaSolverPool.h.

Member Enumeration Documentation

◆ ResultOfInsert

results of insert

Enumerator
SUCCEEDED 

SUCCEEDED.

FAILED_BY_FULL 

FAILED_BY_FULL.

Definition at line 1117 of file bbParaSolverPool.h.

Constructor & Destructor Documentation

◆ CollectingModeSolverHeap()

CollectingModeSolverHeap ( std::size_t  size)

constructor

constructor of selection heap

Parameters
sizeheap size

Definition at line 357 of file bbParaSolverPool.cpp.

References CollectingModeSolverHeap::heap, CollectingModeSolverHeap::heapSize, and CollectingModeSolverHeap::maxHeapSize.

◆ ~CollectingModeSolverHeap()

destructor

destructor of selection heap

Definition at line 367 of file bbParaSolverPool.cpp.

References CollectingModeSolverHeap::heap.

Member Function Documentation

◆ deleteElement()

virtual void deleteElement ( BbParaSolverPoolElementPtr  solver)
pure virtual

◆ downHeap()

virtual void downHeap ( std::size_t  pos)
pure virtual

down heap

Parameters
posstart position to down heap

Implemented in DescendingCollectingModeSolverHeap, and AscendingCollectingModeSolverHeap.

Referenced by CollectingModeSolverHeap::remove().

◆ getHeapSize()

std::size_t getHeapSize ( ) const

get current used heap size

Returns
used heap size

Definition at line 1174 of file bbParaSolverPool.h.

References CollectingModeSolverHeap::heapSize.

Referenced by BbParaSolverPoolForMinimization::updateSolverStatus().

◆ getMaxHeapSize()

std::size_t getMaxHeapSize ( ) const

get max heap size

Returns
max heap size

Definition at line 1184 of file bbParaSolverPool.h.

References CollectingModeSolverHeap::maxHeapSize.

◆ insert()

insert BbParaSolverPoolElementPtr to CollectingModeSolver Heap

Returns
succeeded or fail because of full

insert BbParaSolverPoolElementPtr to selection heap

Parameters
inSolverSolver 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().

◆ remove()

remove top priority BbParaSolverPoolElementPtr from CollectingModeSolver Heap *‍/

Returns
top priority BbParaSolverPoolElementPtr

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().

◆ resize()

void resize ( std::size_t  size)

resize CollectingModeSolver Heap

resize selection heap

Parameters
sizenew size

Definition at line 374 of file bbParaSolverPool.cpp.

References CollectingModeSolverHeap::heap, and CollectingModeSolverHeap::maxHeapSize.

◆ top()

obtain top priority BbParaSolverPoolElementPtr

Returns
top priority BbParaSolverPoolElementPtr

Definition at line 1150 of file bbParaSolverPool.h.

References CollectingModeSolverHeap::heap.

Referenced by BbParaSolverPoolForMinimization::updateSolverStatus().

◆ toString()

◆ updateDualBoundValue()

virtual void updateDualBoundValue ( BbParaSolverPoolElementPtr  solver,
double  value 
)
pure virtual

update CollectingModeSolver heap by a new dual bound value of this Solver

Parameters
solverSolver pool element to be updated
valuedual bound value

Implemented in DescendingCollectingModeSolverHeap, and AscendingCollectingModeSolverHeap.

Referenced by BbParaSolverPoolForMinimization::updateSolverStatus().

◆ upHeap()

virtual void upHeap ( std::size_t  pos)
pure virtual

up heap

Parameters
posstart position to up heap

Implemented in DescendingCollectingModeSolverHeap, and AscendingCollectingModeSolverHeap.

Referenced by CollectingModeSolverHeap::insert().

Member Data Documentation

◆ heap

◆ heapSize

◆ maxHeapSize