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

Float variable array. More...

`#include <float.hh>`

## Creation and initialization

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

## Additional Inherited Members

typedef FloatVar | value_type
| Type of the variable stored in this array.
typedef FloatVar & | reference
| Type of a reference to the value type.
typedef const FloatVar & | const_reference
| Type of a constant reference to the value type.
typedef FloatVar * | pointer
| Type of a pointer to the value type.
typedef const FloatVar * | const_pointer
| Type of a read-only pointer to the value type.
typedef FloatVar * | iterator
| Type of the iterator used to iterate through this array's elements.
typedef const FloatVar * | const_iterator
| Type of the iterator used to iterate read-only through this array's elements.
typedef std::reverse_iterator< FloatVar * > | reverse_iterator
| Type of the iterator used to iterate backwards through this array's elements.
typedef std::reverse_iterator< const FloatVar * > | 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< FloatVar > & | operator= (const VarArray< FloatVar > &a)
| Initialize from variable array a (share elements).
int | size (void) const
| Return size of array (number of elements).
FloatVar & | operator[] (int i)
| Return variable at position i.
ArrayTraits< VarArgArray< FloatVar > >::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< FloatVar > &a)
| Update array to be a clone of array a.
Protected Attributes inherited from Gecode::VarArray< FloatVar >
int | n
| Number of variables (size).
FloatVar * | x
| Array of variables.
Related Symbols inherited from Gecode::VarArray< FloatVar >
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< FloatVar > &x)
| Print array elements enclosed in curly brackets.

## Detailed Description

Float variable array.

Definition at line 1030 of file float.hh.

## Constructor & Destructor Documentation

## FloatVarArray() [1/5]

Gecode::FloatVarArray::FloatVarArray | ( | void |  | ) |

inline

Default constructor (array of size 0).

Definition at line 102 of file array.hpp.

## FloatVarArray() [2/5]

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

inline

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

Definition at line 105 of file array.hpp.

## FloatVarArray() [3/5]

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

inline

Initialize from float variable array a (share elements).

Definition at line 109 of file array.hpp.

## FloatVarArray() [4/5]

Gecode::FloatVarArray::FloatVarArray | ( | Space & | home,
|  | const FloatVarArgs & | a )

inline

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

Definition at line 113 of file array.hpp.

## FloatVarArray() [5/5]

Gecode::FloatVarArray::FloatVarArray | ( | Space & | home,
|  | int | n,
|  | FloatNum | min,
|  | FloatNum | 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::Float::VariableEmptyDomain is thrown.
- If min or max exceed the limits for floats as defined in Gecode::Float::Limits, an exception of type Gecode::Float::OutOfLimits is thrown.

Definition at line 48 of file array.cpp.

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

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