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

#include <InfBucketQueue.hpp>

Collaboration diagram for Bial::InfBucketQueue:
Collaboration graph

Public Member Functions

 InfBucketQueue (size_t size, llint inf_val, llint bucket_size=1.0, bool increasing_order=true, bool fifo_tie=true)
 Basic Constructor. More...
 
size_t Index (llint value)
 Computes and returns the index where the input weight falls. More...
 
void Insert (size_t idt, llint wgt)
 Inserts element of identity idt and weight wgt into the bucket queue. More...
 
int Remove ()
 Removes the next element in the bucket queue. More...
 
void Update (size_t idt, llint cur_wgt, llint new_wgt)
 Updates current weight of element of identity idt. More...
 
bool Empty ()
 Returns true if bucket queue is empty. More...
 
size_t Elements ()
 Returns the number of elements in queue. More...
 
size_t InfiniteElements ()
 Returns the number of inifinite elements in queue. More...
 
bool Increasing () const
 Returns increasing attribute value. More...
 
BucketState State (size_t idt) const
 Returns element state in queue. More...
 
void State (size_t idt, BucketState new_state)
 Sets new state to element of index idt. More...
 
void Finished (size_t idt)
 Sets finished state to element of index idt. More...
 
size_t Buckets () const
 Returns the current number of buckets. More...
 
void ResetState ()
 Sets all element states to NOT_VISITED. More...
 

Protected Member Functions

void Grow (size_t new_size)
 Grows bucket queue size to new_size. More...
 
void Remove (size_t idt, llint 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...
 
llint minimum
 vector containing pointers to elements that fall into each bucket weight. More...
 
llint maximum
 maximum element currently inserted in the queue. More...
 
llint 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...
 
size_t inf_elements
 Whether this queue implements FIFO or LIFO tie-break policy. More...
 
llint infinite_val
 

Detailed Description

Definition at line 31 of file InfBucketQueue.hpp.

Constructor & Destructor Documentation

Bial::InfBucketQueue::InfBucketQueue ( size_t  size,
llint  inf_val,
llint  bucket_size = 1.0,
bool  increasing_order = true,
bool  fifo_tie = true 
)

Basic Constructor.

Date
2015/Jun/24
Parameters
sizeTotal number of elements to be inserted in the queue.
inf_valValue used for infinite.
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.
Warning
none.

Member Function Documentation

size_t Bial::InfBucketQueue::Buckets ( ) const

Returns the current number of buckets.

Date
2015/Jun/24
Parameters
none.
Returns
The current number of buckets.
Warning
none.
size_t Bial::InfBucketQueue::Elements ( )

Returns the number of elements in queue.

Date
2015/Jun/24
Parameters
none.
Returns
Number of elements in queue.
Warning
none.
bool Bial::InfBucketQueue::Empty ( )

Returns true if bucket queue is empty.

Date
2015/Jun/24
Parameters
none.
Returns
Whether bucket queue is empty or not.
Warning
none.
void Bial::InfBucketQueue::Finished ( size_t  idt)

Sets finished state to element of index idt.

Date
2015/Jun/24
Parameters
idtIdentity of the element.
Returns
none.
Warning
none.
void Bial::InfBucketQueue::Grow ( size_t  new_size)
protected

Grows bucket queue size to new_size.

Date
2015/Jun/24
Parameters
new_sizenew weight bucket queue size.
Returns
none.
Warning
none.
bool Bial::InfBucketQueue::Increasing ( ) const

Returns increasing attribute value.

Date
2015/Jun/24
Parameters
none.
Returns
Increasing attribute value.
Warning
none.
size_t Bial::InfBucketQueue::Index ( llint  value)

Computes and returns the index where the input weight falls.

Date
2015/Jun/24
Parameters
valuebucket weight.
Returns
The index where the input weight falls.
Warning
none.
size_t Bial::InfBucketQueue::InfiniteElements ( )

Returns the number of inifinite elements in queue.

Date
2015/Jun/24
Parameters
none.
Returns
Number of inifinite elements in queue.
Warning
none.
void Bial::InfBucketQueue::Insert ( size_t  idt,
llint  wgt 
)

Inserts element of identity idt and weight wgt into the bucket queue.

Date
2015/Jun/24
Parameters
idtidentity of the element.
wgtweight of the element.
Returns
none.
Warning
none.
int Bial::InfBucketQueue::Remove ( )

Removes the next element in the bucket queue.

Date
2015/Jun/24
Parameters
none.
Returns
The next element in the bucket queue.
Warning
none.
void Bial::InfBucketQueue::Remove ( size_t  idt,
llint  wgt 
)
protected

Removes element of identity idt and weight wgt of the bucket queue.

Date
2015/Jun/24
Parameters
idtidentity of the element.
wgtweight of the element.
Returns
none.
Warning
none.
void Bial::InfBucketQueue::ResetState ( )

Sets all element states to NOT_VISITED.

Date
2016/Jan/27
Parameters
none.
Returns
none.
Warning
none.
BucketState Bial::InfBucketQueue::State ( size_t  idt) const

Returns element state in queue.

Date
2015/Jun/24
Parameters
idtidentity of the element.
Returns
Element state in queue.
Warning
none.
void Bial::InfBucketQueue::State ( size_t  idt,
BucketState  new_state 
)

Sets new state to element of index idt.

Date
2015/Jun/24
Parameters
idtIdentity of the element.
new_stateNew state.
Returns
none.
Warning
none.
void Bial::InfBucketQueue::Update ( size_t  idt,
llint  cur_wgt,
llint  new_wgt 
)

Updates current weight of element of identity idt.

Date
2015/Jun/24
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

llint Bial::InfBucketQueue::delta
protected

minimum element currently inserted in the queue.

Definition at line 39 of file InfBucketQueue.hpp.

size_t Bial::InfBucketQueue::elements
protected

step between two consecutive buckets.

Definition at line 40 of file InfBucketQueue.hpp.

bool Bial::InfBucketQueue::fifo
protected

Whether this queue removes elements increasingly or decreasingly.

Definition at line 42 of file InfBucketQueue.hpp.

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

Definition at line 35 of file InfBucketQueue.hpp.

bool Bial::InfBucketQueue::increasing
protected

Number of elements currently in the queue.

Definition at line 41 of file InfBucketQueue.hpp.

size_t Bial::InfBucketQueue::inf_elements
protected

Whether this queue implements FIFO or LIFO tie-break policy.

Definition at line 43 of file InfBucketQueue.hpp.

llint Bial::InfBucketQueue::infinite_val
protected

Definition at line 44 of file InfBucketQueue.hpp.

llint Bial::InfBucketQueue::maximum
protected

maximum element currently inserted in the queue.

Definition at line 38 of file InfBucketQueue.hpp.

llint Bial::InfBucketQueue::minimum
protected

vector containing pointers to elements that fall into each bucket weight.

Definition at line 37 of file InfBucketQueue.hpp.

Vector< WeightNode > Bial::InfBucketQueue::weight
protected

vector containing information about each element ( state, previous, next ).

Definition at line 36 of file InfBucketQueue.hpp.


The documentation for this class was generated from the following file: