This class represents a general sinlge/multidimensional array with constant/variable size dimensions. More...
#include <array.hpp>
Public Types | |
typedef signature_ | signature |
The signature of the array. | |
typedef traits_type_ | traits_type |
The type traits. | |
Public Member Functions | |
array () | |
Default constructs the array. | |
array (const array &other) | |
Initializes the array to a copy of the other array. | |
template<typename other_rep_ > | |
array (const array< signature_, traits_type_, other_rep_ > &other) | |
Initializes the array to a copy of the other array. The other array could have a different representation type. | |
array (int n0,..., int nN) | |
Constructs an array with the given dimension sizes. | |
array (const size_type &size) | |
Constructs an array with the given dimension sizes. | |
array (const value_type &a0,..., const value_type &aT) | |
Constructs an array using the supplied values. | |
template<typename arg_type0_ , ... , typename arg_typeK_ > | |
array (const arg_type0_ &arg0,..., const arg_typeK_ &argK, const size_type &sz) | |
Constructs a reference array by passing the arg0 to argK to the constructor of the iterator which is maintained internally and using the size sz . | |
template<typename other_iterator_type_ , typename other_size_type_ , typename transform_type_ > | |
array (const other_iterator_type_ &it, const other_size_type_ &sz, const transform_type_ &trans) | |
Constructs a reference array by applying the transform trans to the iterator it and size object sz. | |
array & | operator= (const array &other) |
Copies the other array to the current array, possibly resizing the current array. | |
template<typename other_rep_ > | |
array & | operator= (const array< signature_, traits_type_, other_rep_ > &other) |
Copies the other array to the current array, possibly resizing the current array. The other array could have a different representation type. | |
const_iterator | begin () const |
Returns a const iterator pointing to the start of the array. | |
iterator | begin () |
Returns a const iterator pointing to the start of the array. | |
size_type | size () const |
Returns a size object containing the dimension sizes of the array. | |
const_reference | operator() (int i0,..., int iN) const |
Returns a const reference to the element of the array at the specified position. | |
reference | operator() (int i0,..., int iN) |
Returns a reference to the element of the array at the specified position. | |
const_reference | operator[] (int i0) const |
Returns a const reference to the element of the 1D array at the specified index. | |
reference | operator[] (int i0) |
Returns a reference to the element of the 1D array at the specified index. | |
template<typename transform_type_ > | |
const transform_traits< array, transform_type_ >::const_array | operator[] (const transform_type_ &trans) const |
Applies the transform trans to the current array and returns the resulting array. | |
template<typename transform_type_ > | |
const transform_traits< array, transform_type_ >::array | operator[] (const transform_type_ &trans) |
Applies the transform trans to the current array and returns the resulting array. | |
const value_type * | data () const |
Returns a const pointer to the beginning of the array storage. | |
value_type * | data () |
Returns a pointer to the beginning of the array storage. | |
void | resize (int n0,..., int nN) |
Resizes the array dimensions to the specified sizes. | |
void | resize (const size_type &sz) |
Resizes the array dimensions to the specified sizes. | |
void | release () |
Releases the memory allocated for the array and set the size to 0. | |
Public Attributes | |
typedef | value_type |
Type of the elements of the array. | |
typedef | iterator |
Array iterator type. | |
typedef | const_iterator |
Array const iterator type. | |
typedef | reference |
Type of the reference to the elements of the array. | |
typedef | const_reference |
Type of the const reference to the elements of the array. | |
typedef | temporary_array |
A compatible array type with the same signature and traits, suitable for defining temporary variables or return types. | |
typedef | fwd_temporary_array |
A compatible array type with the same signature and traits and forward storage, suitable for defining temporary variables or return types. | |
typedef | rev_temporary_array |
A compatible array type with the same signature and traits and reverse storage, suitable for defining temporary variables or return types. | |
typedef | size_type |
A type that is used to represent and store the size of the arrays with the current signature. | |
Static Public Attributes | |
static const int | dimensions = ... |
The number of dimensions of the array. | |
static const bool | is_reverse = ... |
Indicates whether the array is using reverse storage. |
This class represents a general sinlge/multidimensional array with constant/variable size dimensions.
The set of specializations of this class provides a unified way of representing and working with sinlge/multidimensional arrays with constant/variable size dimensions.
For a detailed explanation see Array Class .
lite::array< signature_, traits_type_, rep_ >::array | ( | ) |
Default constructs the array.
All non-constant dimension sizes are set to 0. The content of the array (in cases it has a fixed size and therefore not initially empty) will be left uninitialized unless the elements of the array have a user-defined type that has its own default constructor. A reference array will be initialized to a null reference.
lite::array< signature_, traits_type_, rep_ >::array | ( | const array< signature_, traits_type_, rep_ > & | other | ) |
lite::array< signature_, traits_type_, rep_ >::array | ( | const array< signature_, traits_type_, other_rep_ > & | other | ) | [inline] |
lite::array< signature_, traits_type_, rep_ >::array | ( | int | n0, | |
..., | ||||
int | nN | |||
) | [explicit] |
Constructs an array with the given dimension sizes.
All non-constant dimension sizes are set to their corresponding supplied value from a0 to aN. The arguments corresponding to fixed-size dimensions are ignored. The array is then allocated. The content of the array will be left uninitialized unless the elements of the array have a user-defined type that has its own default constructor.
lite::array< signature_, traits_type_, rep_ >::array | ( | const size_type & | size | ) | [explicit] |
lite::array< signature_, traits_type_, rep_ >::array | ( | const value_type & | a0, | |
..., | ||||
const value_type & | aT | |||
) |
Constructs an array using the supplied values.
array<double[2]> a(2.3, 4.5);
array<double[3]> a(2.3, 4.5, 4.6);
array<double[9]> a(1, 2, ..., 9); // error: more than LITE_ARRAY_MAX_VECTOR_ARGS number of args.
lite::array< signature_, traits_type_, rep_ >::array | ( | const arg_type0_ & | arg0, | |
..., | ||||
const arg_typeK_ & | argK, | |||
const size_type & | sz | |||
) | [inline] |
Constructs a reference array by passing the arg0 to argK to the constructor of the iterator which is maintained internally and using the size sz .
lite::array< signature_, traits_type_, rep_ >::array | ( | const other_iterator_type_ & | it, | |
const other_size_type_ & | sz, | |||
const transform_type_ & | trans | |||
) | [inline] |
Constructs a reference array by applying the transform trans to the iterator it and size object sz.
operator
[] of array classes to construct a reference array to be returned as the result of applying a transform. value_type* lite::array< signature_, traits_type_, rep_ >::data | ( | ) |
Returns a pointer to the beginning of the array storage.
const value_type* lite::array< signature_, traits_type_, rep_ >::data | ( | ) | const |
Returns a const pointer to the beginning of the array storage.
array& lite::array< signature_, traits_type_, rep_ >::operator= | ( | const array< signature_, traits_type_, other_rep_ > & | other | ) | [inline] |
array& lite::array< signature_, traits_type_, rep_ >::operator= | ( | const array< signature_, traits_type_, rep_ > & | other | ) |
const transform_traits<array, transform_type_>::array lite::array< signature_, traits_type_, rep_ >::operator[] | ( | const transform_type_ & | trans | ) | [inline] |
Applies the transform trans to the current array and returns the resulting array.
const transform_traits<array, transform_type_>::const_array lite::array< signature_, traits_type_, rep_ >::operator[] | ( | const transform_type_ & | trans | ) | const [inline] |
Applies the transform trans to the current array and returns the resulting array.
reference lite::array< signature_, traits_type_, rep_ >::operator[] | ( | int | i0 | ) |
Returns a reference to the element of the 1D array at the specified index.
const_reference lite::array< signature_, traits_type_, rep_ >::operator[] | ( | int | i0 | ) | const |
Returns a const reference to the element of the 1D array at the specified index.
void lite::array< signature_, traits_type_, rep_ >::release | ( | ) |
Releases the memory allocated for the array and set the size to 0.
void lite::array< signature_, traits_type_, rep_ >::resize | ( | const size_type & | sz | ) |
Resizes the array dimensions to the specified sizes.
void lite::array< signature_, traits_type_, rep_ >::resize | ( | int | n0, | |
..., | ||||
int | nN | |||
) |
Resizes the array dimensions to the specified sizes.
The arguments corresponding to fixed-size dimensions are ignored.
const bool lite::array< signature_, traits_type_, rep_ >::is_reverse = ... [static] |
Indicates whether the array is using reverse storage.