Gecode::VarArray array.hpp class Var Var
Associated types
Var typedef Var Gecode::VarArray< Var >::value_type value_type Type of the variable stored in this array. Var & typedef Var& Gecode::VarArray< Var >::reference reference Type of a reference to the value type. const Var & typedef const Var& Gecode::VarArray< Var >::const_reference const_reference Type of a constant reference to the value type. Var * typedef Var* Gecode::VarArray< Var >::pointer pointer Type of a pointer to the value type. const Var * typedef const Var* Gecode::VarArray< Var >::const_pointer const_pointer Type of a read-only pointer to the value type. Var * typedef Var* Gecode::VarArray< Var >::iterator iterator Type of the iterator used to iterate through this array's elements. const Var * typedef const Var* Gecode::VarArray< Var >::const_iterator const_iterator Type of the iterator used to iterate read-only through this array's elements. std::reverse_iterator< Var * > typedef std::reverse_iterator<Var*> Gecode::VarArray< Var >::reverse_iterator reverse_iterator Type of the iterator used to iterate backwards through this array's elements. std::reverse_iterator< const Var * > typedef std::reverse_iterator<const Var*> Gecode::VarArray< Var >::const_reverse_iterator const_reverse_iterator Type of the iterator used to iterate backwards and read-only through this array's elements.
Constructors and initialization
forceinline Gecode::VarArray< Var >::VarArray (void) VarArray void Default constructor (array of size 0) forceinline Gecode::VarArray< Var >::VarArray (Space &home, int m) VarArray Space & home int m Allocate array with m variables. Gecode::VarArray< Var >::VarArray (Space &home, const VarArgArray< Var > &) VarArray Space & home const VarArgArray< Var > & a Initialize from variable argument array a (copy elements) forceinline Gecode::VarArray< Var >::VarArray (const VarArray< Var > &a) VarArray const VarArray< Var > & a Initialize from variable array a (share elements) const VarArray< Var > & const VarArray< Var > & Gecode::VarArray< Var >::operator= (const VarArray< Var > &a) operator= const VarArray< Var > & a Initialize from variable array a (share elements)
Array size
int forceinline int Gecode::VarArray< Var >::size (void) const size void Return size of array (number of elements)
Array elements
Var & forceinline Var & Gecode::VarArray< Var >::operator[] (int i) operator[] int i Return variable at position i. const Var & forceinline const Var & Gecode::VarArray< Var >::operator[] (int i) const operator[] int i Return variable at position i. ArrayTraits< VarArgArray< Var > >::ArgsType ArrayTraits< VarArgArray< Var > >::ArgsType Gecode::VarArray< Var >::slice (int start, int inc=1, int n=-1) slice int start int inc 1 int n -1 Return slice $y$ of length at most n such that forall $0\leq i<n$, $y_i=x_{\text{start}+i\cdot\text{inc}}$If n is -1, then all possible elements starting from start with increment inc are returned.
Array iteration
iterator forceinline VarArray< Var >::iterator Gecode::VarArray< Var >::begin (void) begin void Return an iterator at the beginning of the array. const_iterator forceinline VarArray< Var >::const_iterator Gecode::VarArray< Var >::begin (void) const begin void Return a read-only iterator at the beginning of the array. iterator forceinline VarArray< Var >::iterator Gecode::VarArray< Var >::end (void) end void Return an iterator past the end of the array. const_iterator forceinline VarArray< Var >::const_iterator Gecode::VarArray< Var >::end (void) const end void Return a read-only iterator past the end of the array. reverse_iterator forceinline VarArray< Var >::reverse_iterator Gecode::VarArray< Var >::rbegin (void) rbegin void Return a reverse iterator at the end of the array. const_reverse_iterator forceinline VarArray< Var >::const_reverse_iterator Gecode::VarArray< Var >::rbegin (void) const rbegin void Return a reverse and read-only iterator at the end of the array. reverse_iterator forceinline VarArray< Var >::reverse_iterator Gecode::VarArray< Var >::rend (void) rend void Return a reverse iterator past the beginning of the array. const_reverse_iterator forceinline VarArray< Var >::const_reverse_iterator Gecode::VarArray< Var >::rend (void) const rend void Return a reverse and read-only iterator past the beginning of the array.
Cloning
void forceinline void Gecode::VarArray< Var >::update (Space &, bool share, VarArray< Var > &a) update Space & home bool share VarArray< Var > & a 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.
int int Gecode::VarArray< Var >::n n Number of variables (size) Var * Var* Gecode::VarArray< Var >::x x Array of variables. bool forceinline bool Gecode::VarArray< Var >::assigned (void) const assigned void Test if all variables are assigned. void * forceinline void * Gecode::VarArray< Var >::operator new (size_t) operator new size_t void forceinline void Gecode::VarArray< Var >::operator delete (void *, size_t) operator delete void * size_t class T ArrayTraits< VarArray< T > >::ArgsType ArrayTraits< VarArray< T > >::ArgsType operator+ (const VarArray< T > &x, const VarArgArray< T > &y) operator+ const VarArray< T > & x const VarArgArray< T > & y Concatenate x and y and return result class T ArrayTraits< VarArray< T > >::ArgsType ArrayTraits< VarArray< T > >::ArgsType operator+ (const VarArray< T > &x, const VarArray< T > &y) operator+ const VarArray< T > & x const VarArray< T > & y Concatenate x and y and return result class T ArrayTraits< VarArray< T > >::ArgsType ArrayTraits< VarArray< T > >::ArgsType operator+ (const VarArgArray< T > &x, const VarArray< T > &y) operator+ const VarArgArray< T > & x const VarArray< T > & y Concatenate x and y and return result class T ArrayTraits< VarArray< T > >::ArgsType ArrayTraits< VarArray< T > >::ArgsType operator+ (const VarArray< T > &x, const T &y) operator+ const VarArray< T > & x const T & y Concatenate x and y and return result class T ArrayTraits< VarArray< T > >::ArgsType ArrayTraits< VarArray< T > >::ArgsType operator+ (const T &x, const VarArray< T > &y) operator+ const T & x const VarArray< T > & y Concatenate x and y and return result class Char class Traits class Var std::basic_ostream< Char, Traits > & std::basic_ostream< Char, Traits > & operator<< (std::basic_ostream< Char, Traits > &os, const VarArray< Var > &x) operator<< std::basic_ostream< Char, Traits > & os const VarArray< Var > & x Print array elements enclosed in curly brackets. 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.Variable arrays can be enlarged dynamically. For memory efficiency, the initial array is allocated in the space. When adding variables, it is automatically resized and allocated on the heap. x Gecode::VarArrayassigned Gecode::VarArraybegin Gecode::VarArraybegin Gecode::VarArrayconst_iterator Gecode::VarArrayconst_pointer Gecode::VarArrayconst_reference Gecode::VarArrayconst_reverse_iterator Gecode::VarArrayend Gecode::VarArrayend Gecode::VarArrayiterator Gecode::VarArrayn Gecode::VarArrayoperator delete Gecode::VarArrayoperator new Gecode::VarArrayoperator+ Gecode::VarArrayoperator+ Gecode::VarArrayoperator+ Gecode::VarArrayoperator+ Gecode::VarArrayoperator+ Gecode::VarArrayoperator<< Gecode::VarArrayoperator= Gecode::VarArrayoperator[] Gecode::VarArrayoperator[] Gecode::VarArraypointer Gecode::VarArrayrbegin Gecode::VarArrayrbegin Gecode::VarArrayreference Gecode::VarArrayrend Gecode::VarArrayrend Gecode::VarArrayreverse_iterator Gecode::VarArraysize Gecode::VarArrayslice Gecode::VarArrayupdate Gecode::VarArrayvalue_type Gecode::VarArrayVarArray Gecode::VarArrayVarArray Gecode::VarArrayVarArray Gecode::VarArrayVarArray Gecode::VarArrayx