jplus-0.4.6
|
Typed variant of jarray, performs automatic type conversion on instantiation. More...
#include <src/jarray.h>
Public Member Functions | |
jarray_of_type (const jarray &ja) | |
Initialize with type conversion. | |
T & | operator[] (const I i) |
Directly access element of ravel. | |
const T & | operator[] (const I i) const |
Direct read-only access to an element of ravel. | |
jarray_of_type (jengine *je_) | |
Conveniently allocate scalar. | |
jarray_of_type (jengine *je_, const I l0) | |
Conveniently allocate 1-D array. | |
T & | operator() (const I i0) |
conveniently access 1-D array. | |
const T & | operator() (const I i0) const |
Convenient read-only access to 1-D array. | |
jarray_of_type (jengine *je_, const I l0, const I l1) | |
Conveniently allocate 2-D array. | |
T & | operator() (const I i0, const I i1) |
Conveniently access 2-D array. | |
const T & | operator() (const I i0, const I i1) const |
Convenient read-only access to 2-D array. | |
jarray_of_type (jengine *je_, const I l0, const I l1, const I l2) | |
Conveniently allocate 3-D array. | |
T & | operator() (const I i0, const I i1, const I i2) |
Conveniently access 3-D array. | |
const T & | operator() (const I i0, const I i1, const I i2) const |
Convenient read-only access to 3-D array. | |
jarray_of_type (jengine *je_, const I l0, const I l1, const I l2, const I l3) | |
Conveniently allocate 4-D array. | |
T & | operator() (const I i0, const I i1, const I i2, const I i3) |
Conveniently access 4-D array. | |
const T & | operator() (const I i0, const I i1, const I i2, const I i3) const |
Convenient read-only access to 4-D array. | |
jarray_of_type (jengine *je_, const I l0, const I l1, const I l2, const I l3, const I l4) | |
Conveniently allocate 5-D array. | |
T & | operator() (const I i0, const I i1, const I i2, const I i3, const I i4) |
Conveniently access 5-D array. | |
const T & | operator() (const I i0, const I i1, const I i2, const I i3, const I i4) const |
Convenient read-only access to 5-D array. | |
jarray_of_type (jengine *je_, const I rank, const I *shape) | |
Conveniently allocate n-D array. | |
jarray_of_type (jengine *je_, const std::vector< I > &shape) | |
Conveniently allocate n-D array. | |
T & | operator() (const std::vector< I > &subscripts) |
Conveniently access n-D array. | |
const T & | operator() (const std::vector< I > &subscripts) const |
Convenient read-only access to n-D array. | |
T & | operator() (const I *subscripts) |
Conveniently access n-D array. | |
const T & | operator() (const I *subscripts) const |
Convenient read-only access to n-D array. |
Typed variant of jarray, performs automatic type conversion on instantiation.
jarray_of_type< T >::jarray_of_type | ( | const jarray & | ja | ) | [inline] |
Initialize with type conversion.
In case no conversion is needed the original array is accessed directly, otherwise a copy is made. To access the array members (subscripting) round backets are used like in Blitz++ and not the square ones, like in Boost. Convenience methods are provided for ranks up to 5, for bigger ranks one has to construct and use for indexing an integer vector.
ja | jarray, holding the data. |
References jarray::allocate(), jarray::assign(), jarray::get(), jarray::getEngine(), jarray::rank(), jarray::shape(), jarray::size(), and jarray::type().
jarray_of_type< T >::jarray_of_type | ( | jengine * | je_ | ) | [inline] |
Conveniently allocate scalar.
je_ | jengine to manage memory of this array. |
References jarray::allocate(), and jarray::shape().
jarray_of_type< T >::jarray_of_type | ( | jengine * | je_, |
const I | l0 | ||
) | [inline] |
Conveniently allocate 1-D array.
je_ | jengine to manage memory of this array. |
l0 | new array dimension |
References jarray::allocate(), and jarray::shape().
jarray_of_type< T >::jarray_of_type | ( | jengine * | je_, |
const I | l0, | ||
const I | l1 | ||
) | [inline] |
Conveniently allocate 2-D array.
je_ | jengine to manage memory of this array. |
l0 | new array 1-st dimension |
l1 | new array 2-nd dimension |
References jarray::allocate(), and jarray::shape().
jarray_of_type< T >::jarray_of_type | ( | jengine * | je_, |
const I | l0, | ||
const I | l1, | ||
const I | l2 | ||
) | [inline] |
Conveniently allocate 3-D array.
je_ | jengine to manage memory of this array. |
l0 | new array 1-st dimension |
l1 | new array 2-nd dimension |
l2 | new array 3-rd dimension |
References jarray::allocate(), and jarray::shape().
jarray_of_type< T >::jarray_of_type | ( | jengine * | je_, |
const I | l0, | ||
const I | l1, | ||
const I | l2, | ||
const I | l3 | ||
) | [inline] |
Conveniently allocate 4-D array.
je_ | jengine to manage memory of this array. |
l0 | new array 1-st dimension |
l1 | new array 2-nd dimension |
l2 | new array 3-rd dimension |
l3 | new array 4-th dimension |
References jarray::allocate(), and jarray::shape().
jarray_of_type< T >::jarray_of_type | ( | jengine * | je_, |
const I | l0, | ||
const I | l1, | ||
const I | l2, | ||
const I | l3, | ||
const I | l4 | ||
) | [inline] |
Conveniently allocate 5-D array.
je_ | jengine to manage memory of this array. |
l0 | new array 1-st dimension |
l1 | new array 2-nd dimension |
l2 | new array 3-rd dimension |
l3 | new array 4-th dimension |
l4 | new array 5-th dimension |
References jarray::allocate(), and jarray::shape().
jarray_of_type< T >::jarray_of_type | ( | jengine * | je_, |
const I | rank, | ||
const I * | shape | ||
) | [inline] |
Conveniently allocate n-D array.
je_ | jengine to manage memory of this array. |
rank | rank of new array. |
shape | shape of new array. |
References jarray::allocate().
jarray_of_type< T >::jarray_of_type | ( | jengine * | je_, |
const std::vector< I > & | shape | ||
) | [inline] |
Conveniently allocate n-D array.
je_ | jengine to manage memory of this array. |
shape | shape of new array. |
References jarray::allocate().
T& jarray_of_type< T >::operator() | ( | const I | i0 | ) | [inline] |
conveniently access 1-D array.
i0 | zero-based index of the element to access. |
References jarray::data(), and jarray::rank().
const T& jarray_of_type< T >::operator() | ( | const I | i0 | ) | const [inline] |
Convenient read-only access to 1-D array.
i0 | zero-based index of the element to access. |
References jarray::data(), and jarray::rank().
T& jarray_of_type< T >::operator() | ( | const I | i0, |
const I | i1 | ||
) | [inline] |
Conveniently access 2-D array.
i0 | zero-based 1-st index of the element to access. |
i1 | zero-based 2-nd index of the element to access. |
References jarray::data(), jarray::extent(), and jarray::rank().
const T& jarray_of_type< T >::operator() | ( | const I | i0, |
const I | i1 | ||
) | const [inline] |
Convenient read-only access to 2-D array.
i0 | zero-based 1-st index of the element to access. |
i1 | zero-based 2-nd index of the element to access. |
References jarray::data(), jarray::extent(), and jarray::rank().
T& jarray_of_type< T >::operator() | ( | const I | i0, |
const I | i1, | ||
const I | i2 | ||
) | [inline] |
Conveniently access 3-D array.
i0 | zero-based 1-st index of the element to access. |
i1 | zero-based 2-nd index of the element to access. |
i2 | zero-based 3-rd index of the element to access. |
References jarray::data(), jarray::extent(), and jarray::rank().
const T& jarray_of_type< T >::operator() | ( | const I | i0, |
const I | i1, | ||
const I | i2 | ||
) | const [inline] |
Convenient read-only access to 3-D array.
i0 | zero-based 1-st index of the element to access. |
i1 | zero-based 2-nd index of the element to access. |
i2 | zero-based 3-rd index of the element to access. |
References jarray::data(), jarray::extent(), and jarray::rank().
T& jarray_of_type< T >::operator() | ( | const I | i0, |
const I | i1, | ||
const I | i2, | ||
const I | i3 | ||
) | [inline] |
Conveniently access 4-D array.
i0 | zero-based 1-st index of the element to access. |
i1 | zero-based 2-nd index of the element to access. |
i2 | zero-based 3-rd index of the element to access. |
i3 | zero-based 4-th index of the element to access. |
References jarray::data(), jarray::extent(), and jarray::rank().
const T& jarray_of_type< T >::operator() | ( | const I | i0, |
const I | i1, | ||
const I | i2, | ||
const I | i3 | ||
) | const [inline] |
Convenient read-only access to 4-D array.
i0 | zero-based 1-st index of the element to access. |
i1 | zero-based 2-nd index of the element to access. |
i2 | zero-based 3-rd index of the element to access. |
i3 | zero-based 4-th index of the element to access. |
References jarray::data(), jarray::extent(), and jarray::rank().
T& jarray_of_type< T >::operator() | ( | const I | i0, |
const I | i1, | ||
const I | i2, | ||
const I | i3, | ||
const I | i4 | ||
) | [inline] |
Conveniently access 5-D array.
i0 | zero-based 1-st index of the element to access. |
i1 | zero-based 2-nd index of the element to access. |
i2 | zero-based 3-rd index of the element to access. |
i3 | zero-based 4-th index of the element to access. |
i4 | zero-based 5-th index of the element to access. |
References jarray::data(), jarray::extent(), and jarray::rank().
const T& jarray_of_type< T >::operator() | ( | const I | i0, |
const I | i1, | ||
const I | i2, | ||
const I | i3, | ||
const I | i4 | ||
) | const [inline] |
Convenient read-only access to 5-D array.
i0 | zero-based 1-st index of the element to access. |
i1 | zero-based 2-nd index of the element to access. |
i2 | zero-based 3-rd index of the element to access. |
i3 | zero-based 4-th index of the element to access. |
i4 | zero-based 5-th index of the element to access. |
References jarray::data(), jarray::extent(), and jarray::rank().
T& jarray_of_type< T >::operator() | ( | const std::vector< I > & | subscripts | ) | [inline] |
Conveniently access n-D array.
subscripts | subscripts of the element to access. |
References jarray::data(), jarray::extent(), and jarray::rank().
const T& jarray_of_type< T >::operator() | ( | const std::vector< I > & | subscripts | ) | const [inline] |
Convenient read-only access to n-D array.
subscripts | subscripts of the element to access. |
References jarray::data(), jarray::extent(), and jarray::rank().
T& jarray_of_type< T >::operator() | ( | const I * | subscripts | ) | [inline] |
Conveniently access n-D array.
Be careful, allocating enough subscripts.
subscripts | subscripts of the element to access. |
References jarray::data(), jarray::extent(), and jarray::rank().
const T& jarray_of_type< T >::operator() | ( | const I * | subscripts | ) | const [inline] |
Convenient read-only access to n-D array.
Be careful, allocating enough subscripts.
subscripts | subscripts of the element to access. |
References jarray::data(), jarray::extent(), and jarray::rank().
T& jarray_of_type< T >::operator[] | ( | const I | i | ) | [inline] |
Directly access element of ravel.
i | index. |
References jarray::data().
const T& jarray_of_type< T >::operator[] | ( | const I | i | ) | const [inline] |
Direct read-only access to an element of ravel.
i | index. |
References jarray::data().