Gecode::BoolVarArray Class Reference
Functionality by programming task » Programming models » Using integer variables and constraints » Variable arrays

Boolean variable array. More...

`#include <int.hh>`

## Creation and initialization

| BoolVarArray (void)
| Default constructor (array of size 0).
| BoolVarArray (Space &home, int n)
| Allocate array for n Boolean variables (variables are uninitialized).
| BoolVarArray (const BoolVarArray &a)
| Initialize from Boolean variable array a (share elements).
| BoolVarArray (Space &home, const BoolVarArgs &a)
| Initialize from Boolean variable argument array a (copy elements).
| BoolVarArray (Space &home, int n, int min, int max)
| Initialize array with n new variables.

## Additional Inherited Members

typedef BoolVar | value_type
| Type of the variable stored in this array.
typedef BoolVar & | reference
| Type of a reference to the value type.
typedef const BoolVar & | const_reference
| Type of a constant reference to the value type.
typedef BoolVar * | pointer
| Type of a pointer to the value type.
typedef const BoolVar * | const_pointer
| Type of a read-only pointer to the value type.
typedef BoolVar * | iterator
| Type of the iterator used to iterate through this array's elements.
typedef const BoolVar * | const_iterator
| Type of the iterator used to iterate read-only through this array's elements.
typedef std::reverse_iterator< BoolVar * > | reverse_iterator
| Type of the iterator used to iterate backwards through this array's elements.
typedef std::reverse_iterator< const BoolVar * > | const_reverse_iterator
| Type of the iterator used to iterate backwards and read-only through this array's elements.
| VarArray (void)
| Default constructor (array of size 0).
const VarArray< BoolVar > & | operator= (const VarArray< BoolVar > &a)
| Initialize from variable array a (share elements).
int | size (void) const
| Return size of array (number of elements).
BoolVar & | operator[] (int i)
| Return variable at position i.
ArrayTraits< VarArgArray< BoolVar > >::ArgsType | slice (int start, int inc=1, int n=-1)
iterator | begin (void)
| Return an iterator at the beginning of the array.
iterator | end (void)
| Return an iterator past the end of the array.
reverse_iterator | rbegin (void)
| Return a reverse iterator at the end of the array.
reverse_iterator | rend (void)
| Return a reverse iterator past the beginning of the array.
bool | assigned (void) const
| Test if all variables are assigned.
void | update (Space &home, VarArray< BoolVar > &a)
| Update array to be a clone of array a.
Protected Attributes inherited from Gecode::VarArray< BoolVar >
int | n
| Number of variables (size).
BoolVar * | x
| Array of variables.
Related Symbols inherited from Gecode::VarArray< BoolVar >
ArrayTraits< VarArray< T > >::ArgsType | operator+ (const VarArray< T > &x, const VarArgArray< T > &y)
ArrayTraits< VarArray< T > >::ArgsType | operator+ (const VarArray< T > &x, const VarArray< T > &y)
ArrayTraits< VarArray< T > >::ArgsType | operator+ (const VarArgArray< T > &x, const VarArray< T > &y)
ArrayTraits< VarArray< T > >::ArgsType | operator+ (const VarArray< T > &x, const T &y)
ArrayTraits< VarArray< T > >::ArgsType | operator+ (const T &x, const VarArray< T > &y)
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const VarArray< BoolVar > &x)
| Print array elements enclosed in curly brackets.

## Detailed Description

Boolean variable array.

Definition at line 808 of file int.hh.

## Constructor & Destructor Documentation

## BoolVarArray() [1/5]

Gecode::BoolVarArray::BoolVarArray | ( | void |  | ) |

inline

Default constructor (array of size 0).

Definition at line 159 of file array.hpp.

## BoolVarArray() [2/5]

Gecode::BoolVarArray::BoolVarArray | ( | Space & | home,
|  | int | n )

inline

Allocate array for n Boolean variables (variables are uninitialized).

Definition at line 162 of file array.hpp.

## BoolVarArray() [3/5]

Gecode::BoolVarArray::BoolVarArray | ( | const BoolVarArray & | a | ) |

inline

Initialize from Boolean variable array a (share elements).

Definition at line 166 of file array.hpp.

## BoolVarArray() [4/5]

Gecode::BoolVarArray::BoolVarArray | ( | Space & | home,
|  | const BoolVarArgs & | a )

inline

Initialize from Boolean variable argument array a (copy elements).

Definition at line 170 of file array.hpp.

## BoolVarArray() [5/5]

Gecode::BoolVarArray::BoolVarArray | ( | Space & | home,
|  | int | n,
|  | int | min,
|  | int | max )

Initialize array with n new variables.

The variables are created with a domain ranging from min to max. The following execptions might be thrown:

- If min is greater than max, an exception of type Gecode::Int::VariableEmptyDomain is thrown.
- If min is less than 0 or max is greater than 1, an exception of type Gecode::Int::NotZeroOne is thrown.

Definition at line 58 of file array.cpp.

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

- gecode/int.hh
- gecode/int/array.cpp
- gecode/int/array.hpp