Gecode::VarArray< Var > Class Template Reference
[Programming variables]
List of all members.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 43 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). | |
Array size | |
int | size (void) const |
Return size of array (number of elements). | |
Array elements | |
Var & | operator[] (int i) |
Return variable at position i. | |
const Var & | operator[] (int i) const |
Return variable at position i. | |
Cloning | |
void | update (Space *, bool share, VarArray< Var > &a) |
Update array to be a clone of array a. | |
Protected Attributes | |
int | n |
Number of variables (size). | |
Var * | x |
Array of variables. |
Constructor & Destructor Documentation
|
Default constructor (array of size 0).
|
|
Allocate array with m variables.
|
|
Initialize from variable argument array a (copy elements).
|
|
Initialize from variable array a (share elements).
|
Member Function Documentation
|
Initialize from variable array a (share elements).
|
|
Return size of array (number of elements).
|
|
Return variable at position i.
Reimplemented in Gecode::BoolVarArray. |
|
Return variable at position i.
Reimplemented in Gecode::BoolVarArray. |
|
Update array to be a clone of array a. If share is true, sharing is retained for all shared data structures. Otherwise, for each of them an independent copy is created. |
Member Data Documentation
|
Number of variables (size).
|
|
Array of variables.
|
The documentation for this class was generated from the following file:
- gecode/kernel/array.icc (Revision: 3741)