Gecode::PrimArgArray< T > Class Template Reference
[Programming variables]
Argument array for primtive types. More...
#include <array.hpp>
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). | |
PrimArgArray (const std::vector< T > &a) | |
Initialize from vector a. | |
template<class InputIterator > | |
PrimArgArray (InputIterator first, InputIterator last) | |
Initialize from InputIterator first and last. | |
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 675 of file array.hpp.
Constructor & Destructor Documentation
template<class T >
Gecode::PrimArgArray< T >::PrimArgArray | ( | void | ) | [inline] |
template<class T >
Gecode::PrimArgArray< T >::PrimArgArray | ( | int | n | ) | [inline, explicit] |
template<class T>
Gecode::PrimArgArray< T >::PrimArgArray | ( | int | n, | |
T | e0, | |||
... | ||||
) | [inline] |
template<class T>
Gecode::PrimArgArray< T >::PrimArgArray | ( | int | n, | |
const T * | e | |||
) | [inline] |
template<class T>
Gecode::PrimArgArray< T >::PrimArgArray | ( | const PrimArgArray< T > & | a | ) | [inline] |
template<class T>
Gecode::PrimArgArray< T >::PrimArgArray | ( | const std::vector< T > & | a | ) | [inline] |
template<class T >
template<class InputIterator >
Gecode::PrimArgArray< T >::PrimArgArray | ( | InputIterator | first, | |
InputIterator | last | |||
) | [inline] |
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 of length at most n such that forall ,
If n is -1, then all possible elements starting from start with increment inc are returned.
Reimplemented from Gecode::ArgArrayBase< T >.
template<class T>
ArrayTraits< PrimArgArray< T > >::ArgsType & Gecode::PrimArgArray< T >::operator<< | ( | const T & | x | ) | [inline] |
template<class T>
ArrayTraits< PrimArgArray< T > >::ArgsType & Gecode::PrimArgArray< T >::operator<< | ( | const PrimArgArray< T > & | x | ) | [inline] |
Friends And Related Function Documentation
template<class T>
ArrayTraits< PrimArgArray< T > >::ArgsType operator+ | ( | const PrimArgArray< T > & | x, | |
const PrimArgArray< T > & | y | |||
) | [friend] |
template<class T>
ArrayTraits< PrimArgArray< T > >::ArgsType operator+ | ( | const PrimArgArray< T > & | x, | |
const T & | y | |||
) | [friend] |
template<class T>
ArrayTraits< PrimArgArray< T > >::ArgsType operator+ | ( | const T & | x, | |
const PrimArgArray< T > & | y | |||
) | [friend] |
The documentation for this class was generated from the following file:
- gecode/kernel/array.hpp (Revision: 15170)