User Documentation
Centre for Vision, Speech & Signal Processing
DEVELOP 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<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:
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.


Programmer:Charles Galambos, Documentation by CxxDoc: Tue Mar 20 10:48:08 2001