Developer Documentation
Centre for Vision, Speech & Signal Processing
USER IN NAMESPACE AMMA TREE ROOT AMMA SEARCH AMMA HOME
 

  PUBLIC
RandomBagC::RandomBagC(IntT)
RandomBagC::RandomBagC(const SArray1dC &)
RandomBagC::RandomBagC(const RandomBagC &)
RandomBagC::~RandomBagC(void)
RandomBagC::operator=(const RandomBagC &)
RandomBagC::Reset(IntT)
RandomBagC::Insert(const T &)
RandomBagC::Resize(SizeT)
RandomBagC::Pick(void)
RandomBagC::IsEmpty(void) const
RandomBagC::IsElm(void) const
RandomBagC::Empty(void)
RandomBagC::Size(void) const
RandomBagC::End(void)
RandomBagC::End(void) const
RandomBagC::operator=(const RandomBagC &)
RandomBagC<class T>
 
A collection of data from which items are drawn at random.
 
include "amma/RandBag.hh"
User Level:Default
Library:ContainerMisc
Example:exBiHash.cc
Section:Containers.Misc
In Scope:std

Comments:
This is a BIG object.

Mechanism suggested by G.Matas.

Variables:
SArray1dC Data;

UIntT * end;

Methods:
RandomBagC(IntT Size = 0)
Constructor.

RandomBagC(const SArray1dC<T> & data)
Construct from an array of data.
this assumes that all the entries in 'data' are valid.

NB. This does NOT copy the data from the array and will leave its contents is an unspecified state.


RandomBagC(const RandomBagC & Oth)

~RandomBagC()
Destructor

const RandomBagC<T> & operator=(const RandomBagC & Oth)
Assignment.

void Reset(IntT Size)
Empty pool and set to new size.

BooleanT Insert(const T & Px)
Add new data to pool, returns false if pool is full.

void Resize(SizeT nSize)
Change the size of the pool (Slow).

T Pick(void)
Pick a data item at random from the pool.
NB. Only use if you know the pool is not empty, this can be tested by IsElm().

BooleanT IsEmpty() const
Is pool empty ?

BooleanT IsElm() const
Does pool contain any data ?

void Empty()
Empty it of all data.

IntT Size() const
Number of elements in the pool.

UIntT & End()
Access end point.

UIntT End() const
Access end point.

const RandomBagC<T> & operator=(const RandomBagC<T> & Oth)


Programmer:Charles Galambos, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001