Generated on Thu Mar 22 10:39:53 2012 for Gecode by doxygen 1.6.3

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

Argument array for primtive types. More...

#include <array.hpp>

List of all members.

Friends

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

Constructors and initialization



 PrimArgArray (void)
 Allocate empty array.
 PrimArgArray (int n)
 Allocate array with n elements.
 PrimArgArray (int n, T e0,...)
 Allocate array with n elements and initialize with e0, ...
 PrimArgArray (int n, const T *e)
 Allocate array with n elements and initialize with elements from array e.
 PrimArgArray (const PrimArgArray< T > &a)
 Initialize from primitive argument array a (copy elements).

Array elements



ArrayTraits< PrimArgArray< T >
>::ArgsType 
slice (int start, int inc=1, int n=-1)

Appending elements



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

Detailed Description

template<class T>
class Gecode::PrimArgArray< T >

Argument array for primtive 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 669 of file array.hpp.


Constructor & Destructor Documentation

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

Allocate empty array.

Definition at line 1766 of file array.hpp.

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

Allocate array with n elements.

Definition at line 1770 of file array.hpp.

template<class T>
Gecode::PrimArgArray< T >::PrimArgArray ( int  n,
e0,
  ... 
) [inline]

Allocate array with n elements and initialize with e0, ...

Definition at line 1773 of file array.hpp.

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

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

Definition at line 1784 of file array.hpp.

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

Initialize from primitive argument array a (copy elements).

Definition at line 1792 of file array.hpp.


Member Function Documentation

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

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.

Reimplemented from Gecode::ArgArrayBase< T >.

Definition at line 1797 of file array.hpp.

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

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

Definition at line 1805 of file array.hpp.

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

Append x to the end of the array.

Definition at line 1813 of file array.hpp.


Friends And Related Function Documentation

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

Concatenate x and y and return result

Definition at line 1821 of file array.hpp.

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

Concatenate x and y and return result

Definition at line 1828 of file array.hpp.

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

Concatenate x and y and return result

Definition at line 1835 of file array.hpp.


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