Generated on Fri Mar 20 15:56:45 2015 for Gecode by doxygen 1.6.3

Gecode::ArgArray< T > Class Template Reference
[Programming variables]

Argument array for non-primitive types. More...

#include <array.hpp>

List of all members.

Friends

ArrayTraits< ArgArray< T >
>::ArgsType 
operator+ (const ArgArray< T > &x, const ArgArray< T > &y)
ArrayTraits< ArgArray< T >
>::ArgsType 
operator+ (const ArgArray< T > &x, const T &y)
ArrayTraits< ArgArray< T >
>::ArgsType 
operator+ (const T &x, const ArgArray< T > &y)

Constructors and initialization



 ArgArray (void)
 Allocate empty array.
 ArgArray (int n)
 Allocate array with n elements.
 ArgArray (int n, const T *e)
 Allocate array with n elements and initialize with elements from array e.
 ArgArray (const ArgArray< T > &a)
 Initialize from primitive argument array a (copy elements).
 ArgArray (const std::vector< T > &a)
 Initialize from vector a.
template<class InputIterator >
 ArgArray (InputIterator first, InputIterator last)
 Initialize from InputIterator first and last.

Array elements



ArrayTraits< ArgArray< T >
>::ArgsType 
slice (int start, int inc=1, int n=-1)
 Return slice $y$ of length n such that forall $0\leq i<n$, $y_i=x_{\text{start}+i\cdot\text{inc}}$.

Appending elements



ArrayTraits< ArgArray< T >
>::ArgsType & 
operator<< (const T &x)
 Insert a new element x at the end of the array (increase size by 1).
ArrayTraits< ArgArray< T >
>::ArgsType & 
operator<< (const ArgArray< T > &x)
 Append x to the end of the array.

Detailed Description

template<class T>
class Gecode::ArgArray< T >

Argument array for non-primitive types.

Argument arrays are used as convenient mechanism of passing arguments when calling functions as they combine both the size and the elements of an array. For a small number of elements, memory is allocated by creating an argument array object. Otherwise the memory is allocated from the heap.

Definition at line 762 of file array.hpp.


Constructor & Destructor Documentation

template<class T >
Gecode::ArgArray< T >::ArgArray ( void   )  [inline]

Allocate empty array.

Definition at line 1908 of file array.hpp.

template<class T >
Gecode::ArgArray< T >::ArgArray ( int  n  )  [inline, explicit]

Allocate array with n elements.

Definition at line 1912 of file array.hpp.

template<class T>
Gecode::ArgArray< T >::ArgArray ( int  n,
const T *  e 
) [inline]

Allocate array with n elements and initialize with elements from array e.

Definition at line 1915 of file array.hpp.

template<class T>
Gecode::ArgArray< T >::ArgArray ( const ArgArray< T > &  a  )  [inline]

Initialize from primitive argument array a (copy elements).

Definition at line 1923 of file array.hpp.

template<class T>
Gecode::ArgArray< T >::ArgArray ( const std::vector< T > &  a  )  [inline]

Initialize from vector a.

Definition at line 1928 of file array.hpp.

template<class T >
template<class InputIterator >
Gecode::ArgArray< T >::ArgArray ( InputIterator  first,
InputIterator  last 
) [inline]

Initialize from InputIterator first and last.

Definition at line 1934 of file array.hpp.


Member Function Documentation

template<class T >
ArrayTraits< ArgArray< T > >::ArgsType Gecode::ArgArray< T >::slice ( int  start,
int  inc = 1,
int  n = -1 
) [inline]

Return slice $y$ of length n such that forall $0\leq i<n$, $y_i=x_{\text{start}+i\cdot\text{inc}}$.

Reimplemented from Gecode::ArgArrayBase< T >.

Definition at line 1939 of file array.hpp.

template<class T>
ArrayTraits< ArgArray< T > >::ArgsType & Gecode::ArgArray< T >::operator<< ( const T &  x  )  [inline]

Insert a new element x at the end of the array (increase size by 1).

Definition at line 1947 of file array.hpp.

template<class T>
ArrayTraits< ArgArray< T > >::ArgsType & Gecode::ArgArray< T >::operator<< ( const ArgArray< T > &  x  )  [inline]

Append x to the end of the array.

Definition at line 1955 of file array.hpp.


Friends And Related Function Documentation

template<class T>
ArrayTraits< ArgArray< T > >::ArgsType operator+ ( const ArgArray< T > &  x,
const ArgArray< T > &  y 
) [friend]

Concatenate x and y and return result

Definition at line 1963 of file array.hpp.

template<class T>
ArrayTraits< ArgArray< T > >::ArgsType operator+ ( const ArgArray< T > &  x,
const T &  y 
) [friend]

Concatenate x and y and return result

Definition at line 1970 of file array.hpp.

template<class T>
ArrayTraits< ArgArray< T > >::ArgsType operator+ ( const T &  x,
const ArgArray< T > &  y 
) [friend]

Concatenate x and y and return result

Definition at line 1977 of file array.hpp.


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