Standard bucket queue class, that may work with both integer or real values.
More...
#include <BucketQueue.hpp>
|
virtual size_t | Index (ldbl value) |
| Computes and returns the index where the input weight falls. More...
|
|
virtual void | Grow (size_t new_size) |
| Grows bucket queue size to new_size. More...
|
|
virtual void | Remove (size_t idt, ldbl wgt) |
| Removes element of identity idt and weight wgt of the bucket queue. More...
|
|
Standard bucket queue class, that may work with both integer or real values.
Definition at line 31 of file BucketQueue.hpp.
Bial::BucketQueue::BucketQueue |
( |
size_t |
size, |
|
|
ldbl |
bucket_size = 1.0 , |
|
|
bool |
increasing_order = true , |
|
|
bool |
fifo_tie = true |
|
) |
| |
Whether this queue implements FIFO or LIFO tie-break policy.
- Date
- 2012/Sep/06
- Parameters
-
size | Total number of elements to be inserted in the queue. |
bucket_size | the size of the bucket. Elements whose weight difference is lower than the bucket_size may fall into the same bucket. |
increasing_order | increasing or decreasing order of bucket queue output. |
fifo_tie | fifo or lifo tiebreak. |
- Returns
- none. Basic Constructor.
- Warning
- none.
virtual Bial::BucketQueue::~BucketQueue |
( |
| ) |
|
|
inlinevirtual |
Virutal Destructor.
- Date
- 2015/Jun/24
- Parameters
-
- Returns
- none.
- Warning
- none.
Definition at line 65 of file BucketQueue.hpp.
virtual size_t Bial::BucketQueue::Buckets |
( |
| ) |
const |
|
virtual |
Returns the current number of buckets.
- Date
- 2012/Sep/21
- Parameters
-
- Returns
- The current number of buckets.
- Warning
- none.
virtual size_t Bial::BucketQueue::Elements |
( |
| ) |
|
|
virtual |
Returns the number of elements in queue.
- Date
- 2013/Oct/14
- Parameters
-
- Returns
- Number of elements in queue.
- Warning
- none.
virtual bool Bial::BucketQueue::Empty |
( |
| ) |
|
|
virtual |
Returns true if bucket queue is empty.
- Date
- 2012/Sep/06
- Parameters
-
- Returns
- Whether bucket queue is empty or not.
- Warning
- none.
virtual void Bial::BucketQueue::Finished |
( |
size_t |
idt | ) |
|
|
virtual |
Sets finished state to element of index idt.
- Date
- 2012/Sep/25
- Parameters
-
idt | Identity of the element. |
- Returns
- none.
- Warning
- none.
virtual void Bial::BucketQueue::Grow |
( |
size_t |
new_size | ) |
|
|
protectedvirtual |
Grows bucket queue size to new_size.
- Date
- 2012/Sep/06
- Parameters
-
new_size | new weight bucket queue size. |
- Returns
- none.
- Warning
- none.
virtual bool Bial::BucketQueue::Increasing |
( |
| ) |
const |
|
virtual |
Returns increasing attribute value.
- Date
- 2012/Sep/06
- Parameters
-
- Returns
- Increasing attribute value.
- Warning
- none.
virtual size_t Bial::BucketQueue::Index |
( |
ldbl |
value | ) |
|
|
protectedvirtual |
Computes and returns the index where the input weight falls.
- Date
- 2013/Oct/11
- Parameters
-
- Returns
- The index where the input weight falls.
- Warning
- none.
virtual void Bial::BucketQueue::Insert |
( |
size_t |
idt, |
|
|
ldbl |
wgt |
|
) |
| |
|
virtual |
Inserts element of identity idt and weight wgt into the bucket queue.
- Date
- 2012/Sep/06
- Parameters
-
idt | identity of the element. |
wgt | weight of the element. |
- Returns
- none.
- Warning
- none.
virtual int Bial::BucketQueue::Remove |
( |
| ) |
|
|
virtual |
Removes the next element in the bucket queue.
- Date
- 2012/Sep/06
- Parameters
-
- Returns
- The next element in the bucket queue.
- Warning
- none.
virtual void Bial::BucketQueue::Remove |
( |
size_t |
idt, |
|
|
ldbl |
wgt |
|
) |
| |
|
protectedvirtual |
Removes element of identity idt and weight wgt of the bucket queue.
- Date
- 2012/Sep/06
- Parameters
-
idt | identity of the element. |
wgt | weight of the element. |
- Returns
- none.
- Warning
- none.
virtual void Bial::BucketQueue::ResetState |
( |
| ) |
|
|
virtual |
Sets all element states to NOT_VISITED.
- Date
- 2016/Jan/27
- Parameters
-
- Returns
- none.
- Warning
- none.
virtual BucketState Bial::BucketQueue::State |
( |
size_t |
idt | ) |
const |
|
virtual |
Returns element state in queue.
- Date
- 2012/Sep/19
- Parameters
-
idt | identity of the element. |
- Returns
- Element state in queue.
- Warning
- none.
virtual void Bial::BucketQueue::State |
( |
size_t |
idt, |
|
|
BucketState |
new_state |
|
) |
| |
|
virtual |
Sets new state to element of index idt.
- Date
- 2012/Sep/25
- Parameters
-
idt | Identity of the element. |
new_state | New state. |
- Returns
- none.
- Warning
- none.
virtual void Bial::BucketQueue::Update |
( |
size_t |
idt, |
|
|
ldbl |
cur_wgt, |
|
|
ldbl |
new_wgt |
|
) |
| |
|
virtual |
Updates current weight of element of identity idt.
- Date
- 2012/Sep/06
- Parameters
-
idt | identity of the element. |
cur_wgt | current weight of the element. |
new_wgt | the new weight assigned to the element. |
- Returns
- none.
- Warning
- none.
ldbl Bial::BucketQueue::delta |
|
protected |
minimum element currently inserted in the queue.
Definition at line 38 of file BucketQueue.hpp.
size_t Bial::BucketQueue::elements |
|
protected |
bool Bial::BucketQueue::fifo |
|
protected |
Whether this queue removes elements increasingly or decreasingly.
Definition at line 41 of file BucketQueue.hpp.
bool Bial::BucketQueue::increasing |
|
protected |
Number of elements currently in the queue.
Definition at line 40 of file BucketQueue.hpp.
ldbl Bial::BucketQueue::maximum |
|
protected |
maximum element currently inserted in the queue.
Definition at line 37 of file BucketQueue.hpp.
ldbl Bial::BucketQueue::minimum |
|
protected |
vector containing pointers to elements that fall into each bucket weight.
Definition at line 36 of file BucketQueue.hpp.
vector containing information about each element ( state, previous, next ).
Definition at line 35 of file BucketQueue.hpp.
The documentation for this class was generated from the following file: