Gecode::VarArray< Var > Class Template Reference
[Programming variables]
Inherited by Gecode::BoolVarArray, Gecode::CpltSetVarArray, Gecode::IntVarArray, and Gecode::SetVarArray.
Detailed Description
template<class Var>
class Gecode::VarArray< Var >
Variable arrays
Variable arrays store variables. They are typically used for storing the variables being part of a solution.
Never use them for temporary purposes, use argument arrays instead.
Definition at line 59 of file array.icc.
Constructors and initialization | |
VarArray (void) | |
Default constructor (array of size 0). | |
VarArray (Space *, int m) | |
Allocate array with m variables. | |
VarArray (Space *, const VarArgArray< Var > &) | |
Initialize from variable argument array a (copy elements). | |
VarArray (const VarArray< Var > &a) | |
Initialize from variable array a (share elements). | |
const VarArray< Var > & | operator= (const VarArray< Var > &a) |
Initialize from variable array a (share elements). | |
~VarArray (void) | |
Destructor. | |
Array size | |
int | size (void) const |
Return size of array (number of elements). | |
void | resize (Space *home, int m) |
Insert or remove (uninitialized!) elements at the end such that size becomes m. | |
Array elements | |
Var & | operator[] (int i) |
Return variable at position i. | |
const Var & | operator[] (int i) const |
Return variable at position i. | |
void | add (Space *home, const Var &v) |
Insert a new element v at the end of the array (increase size by 1). | |
Cloning | |
void | update (Space *, bool share, VarArray< Var > &a) |
Update array to be a clone of array a. | |
Protected Attributes | |
int | used |
Number of variables (size). | |
int | n |
Allocated size of the array. | |
Var * | x |
Array of variables. |
Constructor & Destructor Documentation
template<class Var>
Gecode::VarArray< Var >::VarArray | ( | void | ) | [inline] |
template<class Var>
Gecode::VarArray< Var >::VarArray | ( | Space * | home, | |
int | m | |||
) | [inline] |
template<class Var>
Gecode::VarArray< Var >::VarArray | ( | Space * | home, | |
const VarArgArray< Var > & | a | |||
) | [inline] |
template<class Var>
Gecode::VarArray< Var >::VarArray | ( | const VarArray< Var > & | a | ) | [inline] |
template<class Var>
Gecode::VarArray< Var >::~VarArray | ( | void | ) | [inline] |
Member Function Documentation
template<class Var>
const VarArray< Var > & Gecode::VarArray< Var >::operator= | ( | const VarArray< Var > & | a | ) | [inline] |
template<class Var>
int Gecode::VarArray< Var >::size | ( | void | ) | const [inline] |
template<class Var>
void Gecode::VarArray< Var >::resize | ( | Space * | home, | |
int | m | |||
) | [inline] |
template<class Var>
Var & Gecode::VarArray< Var >::operator[] | ( | int | i | ) | [inline] |
template<class Var>
const Var & Gecode::VarArray< Var >::operator[] | ( | int | i | ) | const [inline] |
template<class Var>
void Gecode::VarArray< Var >::add | ( | Space * | home, | |
const Var & | v | |||
) | [inline] |
template<class Var>
void Gecode::VarArray< Var >::update | ( | Space * | home, | |
bool | share, | |||
VarArray< Var > & | a | |||
) | [inline] |
Member Data Documentation
template<class Var>
int Gecode::VarArray< Var >::used [protected] |
template<class Var>
int Gecode::VarArray< Var >::n [protected] |
template<class Var>
Var* Gecode::VarArray< Var >::x [protected] |
The documentation for this class was generated from the following file:
- gecode/kernel/array.icc (Revision: 6240)