coco::variable_indicator Class Reference
[Evaluators]

Bitmap class used to indicate variable occurrence. More...

#include <evaluator.h>

List of all members.

Public Member Functions

 variable_indicator ()
 variable_indicator (int num_of_vars)
 variable_indicator (const std::vector< int > &__v, int num_of_vars)
 variable_indicator (const variable_indicator &__x)
virtual ~variable_indicator ()
void reserve (int num_of_vars)
void set_all (const variable_indicator &_vi)
void set (int __i)
void set (std::vector< int > __v)
void set (int start_idx, int end_idx)
void clear ()
void unset (int __i)
void unset (std::vector< int > __v)
void unset (int start_idx, int end_idx)
unsigned int sum (int start_idx, int end_idx) const
bool test (int __i) const
bool match (const variable_indicator &__v) const
variable_indicatoroperator= (const variable_indicator &__v)
bool operator== (const variable_indicator &__v)
std::vector< int > encode ()
void decode (const std::vector< int > &__e)


Detailed Description

This class is a bitmap class, which is used to indicate which variables share a certain property. E.g., from which variables an expression depends, which variables have been changed since the last evaluation, and the like.

Definition at line 73 of file evaluator.h.


Constructor & Destructor Documentation

coco::variable_indicator::variable_indicator (  )  [inline]

Standard Constructor

Definition at line 80 of file evaluator.h.

coco::variable_indicator::variable_indicator ( int  num_of_vars  )  [inline]

This is a constructor preparing for num_of_vars variables.

Definition at line 83 of file evaluator.h.

coco::variable_indicator::variable_indicator ( const std::vector< int > &  __v,
int  num_of_vars 
) [inline]

This is a constructor preparing for num_of_vars variables, which sets all those variables, whose number appears in __v.

Definition at line 87 of file evaluator.h.

coco::variable_indicator::variable_indicator ( const variable_indicator __x  )  [inline]

Standard Copy Constructor

Definition at line 95 of file evaluator.h.

virtual coco::variable_indicator::~variable_indicator (  )  [inline, virtual]

Standard Destructor

Definition at line 98 of file evaluator.h.


Member Function Documentation

void coco::variable_indicator::clear (  )  [inline]

The clear method unsets all variables in the variable_indicator

Definition at line 160 of file evaluator.h.

void coco::variable_indicator::decode ( const std::vector< int > &  __e  )  [inline]

This method decodes a variable_indicator from a vector<int>. This operation is the inversion of the encode method.

Definition at line 282 of file evaluator.h.

std::vector<int> coco::variable_indicator::encode (  )  [inline]

This method encodes a variable_indicator as a vector<int> so that it can be, e.g., stored in a basic_alltype.

Definition at line 271 of file evaluator.h.

bool coco::variable_indicator::match ( const variable_indicator __v  )  const [inline]

The match method compares this variable_indicator with the variable_indicator __v. It returns if the two bitsets are disjoint.

Definition at line 242 of file evaluator.h.

variable_indicator& coco::variable_indicator::operator= ( const variable_indicator __v  )  [inline]

Standard Assignment Operator

Definition at line 257 of file evaluator.h.

bool coco::variable_indicator::operator== ( const variable_indicator __v  )  [inline]

Standard Comparison Operator

Definition at line 264 of file evaluator.h.

void coco::variable_indicator::reserve ( int  num_of_vars  )  [inline]

This method prepares enough memory that no reallocation is necessary, when num_of_vars have to be stored.

Definition at line 102 of file evaluator.h.

void coco::variable_indicator::set ( int  start_idx,
int  end_idx 
) [inline]

This method sets all variables with numbers in {[start_idx,end_idx[}.

Definition at line 140 of file evaluator.h.

void coco::variable_indicator::set ( std::vector< int >  __v  )  [inline]

With this set method all the variables with numbers in __v can be set.

Definition at line 132 of file evaluator.h.

void coco::variable_indicator::set ( int  __i  )  [inline]

This method sets (sets the bit in the bitmap) the variable with number __i.

Definition at line 126 of file evaluator.h.

void coco::variable_indicator::set_all ( const variable_indicator _vi  )  [inline]

The set_all method sets bits for all those variables (within the valid set of numbers, i.e. variable number < num_of_vars) which are set in _vi.

Definition at line 112 of file evaluator.h.

unsigned int coco::variable_indicator::sum ( int  start_idx,
int  end_idx 
) const [inline]

The sum method counts the number of variables which are set in the number range {[start_idx,end_idx[}.

Definition at line 204 of file evaluator.h.

bool coco::variable_indicator::test ( int  __i  )  const [inline]

This method returns whether the variable __i is set.

Definition at line 234 of file evaluator.h.

void coco::variable_indicator::unset ( int  start_idx,
int  end_idx 
) [inline]

This method unsets all variables with numbers in {[start_idx,end_idx[}.

Definition at line 183 of file evaluator.h.

void coco::variable_indicator::unset ( std::vector< int >  __v  )  [inline]

With this unset method all the variables with numbers in __v can be unset.

Definition at line 175 of file evaluator.h.

void coco::variable_indicator::unset ( int  __i  )  [inline]

This method unsets (clears the bit in the bitmap) the variable with number __i.

Definition at line 168 of file evaluator.h.


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

Generated on Tue Feb 9 14:48:22 2010 for COCONUT API by  doxygen 1.5.8