ibex::BlockSet Class Reference

Set of variables blocks. More...

#include <IbexBlockSet.h>

List of all members.

Public Member Functions

 BlockSet (int nb_var, int nb_blk) throw (BlockSetException)
 BlockSet (const BlockSet &)
 ~BlockSet ()
void rem_var (int var) throw (BlockSetException)
void set_blk (int var, int blk) throw (BlockSetException)
int blk (int var) const throw (BlockSetException)
int next (int var) const throw (BlockSetException)
int first (int blk) const throw (BlockSetException)
int last (int blk) const throw (BlockSetException)
bool noblk (int var) const throw (BlockSetException)
bool empty (int blk) const throw (BlockSetException)

Public Attributes

const int nb_var
const int nb_blk


Detailed Description

Set of variables blocks.

This class allows to create a parition of variables, i.e., divide variables up into various blocks. Some algorithms (e.g., see ibex::BlockRoundRobin or ibex::MultiSystem::MultiSystem(const System&, const BlockSet&)) requires variables to be organized by blocks. E.g., instead of taking a usual set of variables such as {0,1,2,3,4,5}, it takes a collection of subsets such as { {0,2,5}, {3}, {1,4} }.

Note:
Some variables may not belong to a block and a block can be empty. However, such situations may not be valid for algorithms using instances of this class.
See also:
ibex::BlockRoundRobin and ibex::MultiSystem::MultiSystem(const System&, const BlockSet&)
Author:
Gilles Chabert
Date:
March 2007

Constructor & Destructor Documentation

ibex::BlockSet::BlockSet ( int  nb_var,
int  nb_blk 
) throw (BlockSetException)

Create a set of nb_blk empty blocks.

Parameters:
nb_var - the number of variables to be divided. This number if fixed.
nb_blk - the number of blocks. This number is fixed.
Exceptions:
BlockSetException - if nb_blk exceeds nb_var.

ibex::BlockSet::BlockSet ( const BlockSet bs  ) 

Duplicate the set of variable blocks.

ibex::BlockSet::~BlockSet (  ) 

Delete the set of variable blocks.


Member Function Documentation

void ibex::BlockSet::rem_var ( int  var  )  throw (BlockSetException)

Remove a variable from its block.

Exceptions:
BlockSetException - if the variable is not in a block.
remove a variable from the blocks

void ibex::BlockSet::set_blk ( int  var,
int  blk 
) throw (BlockSetException)

Add a variable into a block.

If the variable is already within a block, it is first removed from the latter.

Parameters:
var - the variable to add.
blk - the block.
Exceptions:
BlockSetException - if var or blk exceeds bounds.

int ibex::BlockSet::blk ( int  var  )  const throw (BlockSetException) [inline]

Return the block of a variable.

int ibex::BlockSet::next ( int  var  )  const throw (BlockSetException) [inline]

Return the variable following var in a block, in a circular way (if var is the last variable of the block, then the method returns the first variable of the block).

Exceptions:
BlockSetException - if var exceeds the number of variables or if the variable is in no block.

int ibex::BlockSet::first ( int  blk  )  const throw (BlockSetException) [inline]

Return the first variable of the block blk.

int ibex::BlockSet::last ( int  blk  )  const throw (BlockSetException) [inline]

Return the last variable of the block blk.

bool ibex::BlockSet::noblk ( int  var  )  const throw (BlockSetException) [inline]

Return true if the variable var is not in a block.

bool ibex::BlockSet::empty ( int  blk  )  const throw (BlockSetException) [inline]

Return true if the block blk is empty.


Member Data Documentation

The number of variables to divide up into blocks.

The number of blocks.


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

Generated on Sun Jun 27 15:52:00 2010 for IBEX by  doxygen 1.5.5