Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
Bial::BucketQueue Class Reference

Standard bucket queue class, that may work with both integer or real values. More...

#include <BucketQueue.hpp>

Collaboration diagram for Bial::BucketQueue:
Collaboration graph

Public Member Functions

 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. More...
 
virtual ~BucketQueue ()
 Virutal Destructor. More...
 
virtual void Insert (size_t idt, ldbl wgt)
 Inserts element of identity idt and weight wgt into the bucket queue. More...
 
virtual int Remove ()
 Removes the next element in the bucket queue. More...
 
virtual void Update (size_t idt, ldbl cur_wgt, ldbl new_wgt)
 Updates current weight of element of identity idt. More...
 
virtual bool Empty ()
 Returns true if bucket queue is empty. More...
 
virtual size_t Elements ()
 Returns the number of elements in queue. More...
 
virtual bool Increasing () const
 Returns increasing attribute value. More...
 
virtual BucketState State (size_t idt) const
 Returns element state in queue. More...
 
virtual void State (size_t idt, BucketState new_state)
 Sets new state to element of index idt. More...
 
virtual void Finished (size_t idt)
 Sets finished state to element of index idt. More...
 
virtual size_t Buckets () const
 Returns the current number of buckets. More...
 
virtual void ResetState ()
 Sets all element states to NOT_VISITED. More...
 

Protected Member Functions

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

Protected Attributes

Vector< IdentityNodeidentity
 
Vector< WeightNodeweight
 vector containing information about each element ( state, previous, next ). More...
 
ldbl minimum
 vector containing pointers to elements that fall into each bucket weight. More...
 
ldbl maximum
 maximum element currently inserted in the queue. More...
 
ldbl delta
 minimum element currently inserted in the queue. More...
 
size_t elements
 step between two consecutive buckets. More...
 
bool increasing
 Number of elements currently in the queue. More...
 
bool fifo
 Whether this queue removes elements increasingly or decreasingly. More...
 

Detailed Description

Standard bucket queue class, that may work with both integer or real values.

Definition at line 31 of file BucketQueue.hpp.

Constructor & Destructor Documentation

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
sizeTotal number of elements to be inserted in the queue.
bucket_sizethe size of the bucket. Elements whose weight difference is lower than the bucket_size may fall into the same bucket.
increasing_orderincreasing or decreasing order of bucket queue output.
fifo_tiefifo or lifo tiebreak.
Returns
none. Basic Constructor.
Warning
none.
virtual Bial::BucketQueue::~BucketQueue ( )
inlinevirtual

Virutal Destructor.

Date
2015/Jun/24
Parameters
none.
Returns
none.
Warning
none.

Definition at line 65 of file BucketQueue.hpp.

Member Function Documentation

virtual size_t Bial::BucketQueue::Buckets ( ) const
virtual

Returns the current number of buckets.

Date
2012/Sep/21
Parameters
none.
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
none.
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
none.
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
idtIdentity 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_sizenew weight bucket queue size.
Returns
none.
Warning
none.
virtual bool Bial::BucketQueue::Increasing ( ) const
virtual

Returns increasing attribute value.

Date
2012/Sep/06
Parameters
none.
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
valuebucket weight.
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
idtidentity of the element.
wgtweight 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
none.
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
idtidentity of the element.
wgtweight 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
none.
Returns
none.
Warning
none.
virtual BucketState Bial::BucketQueue::State ( size_t  idt) const
virtual

Returns element state in queue.

Date
2012/Sep/19
Parameters
idtidentity 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
idtIdentity of the element.
new_stateNew 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
idtidentity of the element.
cur_wgtcurrent weight of the element.
new_wgtthe new weight assigned to the element.
Returns
none.
Warning
none.

Member Data Documentation

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

step between two consecutive buckets.

Definition at line 39 of file BucketQueue.hpp.

bool Bial::BucketQueue::fifo
protected

Whether this queue removes elements increasingly or decreasingly.

Definition at line 41 of file BucketQueue.hpp.

Vector< IdentityNode > Bial::BucketQueue::identity
protected

Definition at line 34 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< WeightNode > Bial::BucketQueue::weight
protected

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: