#include <ArrayIndexing.h>
Inheritance diagram for ads::ArrayIndexing< N, T >:

Public Types | |
| typedef types::value_type | value_type |
| The element type of the array. | |
| typedef types::parameter_type | parameter_type |
| The parameter type. | |
| typedef types::unqualified_value_type | unqualified_value_type |
| The unqualified value type. | |
| typedef types::pointer | pointer |
| A pointer to an array element. | |
| typedef types::const_pointer | const_pointer |
| A pointer to a constant array element. | |
| typedef types::reference | reference |
| A reference to an array element. | |
| typedef types::const_reference | const_reference |
| A reference to a constant array element. | |
| typedef types::size_type | size_type |
| The size type is a signed integer. | |
| typedef types::difference_type | difference_type |
| Pointer difference type. | |
| typedef FixedArray< N, int > | index_type |
| A multi-index. Index in N dimensions. | |
| typedef IndexRange< N, int > | range_type |
| A range of multi-indices. | |
|
typedef ArrayIndexIterator< N > | index_iterator |
| A multi-index iterator. | |
Public Member Functions | |
Accessors | |
| const index_type & | extents () const |
| Return the extents of the array. | |
| size_type | extent (const int i) const |
Return the extent of the array. | |
| const range_type & | ranges () const |
| Return the index ranges of the array. | |
| const index_type & | lbounds () const |
| Return the index lower bounds. | |
| const index_type & | ubounds () const |
| Return the index upper bounds. | |
| int | lbound (const int i) const |
Return the lower bound. | |
| int | ubound (const int i) const |
Return the upper bound. | |
| const index_type & | strides () const |
| Return the strides between elements in each dimension. | |
| index_iterator | indices_begin () const |
| Return an index iterator to the beginning of the indices. | |
| index_iterator | indices_end () const |
| Return an index iterator to the end of the indices. | |
| const_pointer | root () const |
| Return the root for indexing, i.e., the location of (*this)(lbounds()). | |
Accessors: Indexing. | |
| parameter_type | operator() (const index_type &mi) const |
| Return the specified element. | |
| parameter_type | operator() (const int i0, const int i1) const |
| Return the specified the element. | |
| parameter_type | operator() (const int i0, const int i1, const int i2) const |
| Return the specified the element. | |
| parameter_type | operator() (const ads::FixedArray< 1, int > &index, const ads::FixedArray< 1, int > &offset) const |
| Return the element specified by the index and offset. | |
| parameter_type | operator() (const ads::FixedArray< 2, int > &index, const ads::FixedArray< 2, int > &offset) const |
| Return the element specified by the index and offset. | |
| parameter_type | operator() (const ads::FixedArray< 3, int > &index, const ads::FixedArray< 3, int > &offset) const |
| Return the element specified by the index and offset. | |
Accessors: Convert between a container index and a multi-index. | |
| int | index (const index_type &mi) const |
| Convert a multi-index to a container index. | |
| int | index (const int i0, const int i1) const |
| Convert a multi-index to a container index. | |
| int | index (const int i0, const int i1, const int i2) const |
| Convert a multi-index to a container index. | |
| void | index_to_indices (const int index, int &i, int &j) const |
| Convert a container index to indices in a 2-D array. | |
| void | index_to_indices (int index, int &i, int &j, int &k) const |
| Convert a container index to indices in a 3-D array. | |
| void | index_to_indices (const int index, ads::FixedArray< 2, int > &multi_index) const |
| Convert a container index to indices in a 2-D array. | |
| void | index_to_indices (const int index, ads::FixedArray< 3, int > &multi_index) const |
| Convert a container index to indices in a 3-D array. | |
Manipulators. | |
| pointer | root () |
| Return the root for indexing. | |
Manipulators: Array indexing. | |
| reference | operator() (const index_type &mi) |
| Return a reference to the element. | |
| reference | operator() (const int i0, const int i1) |
| Return a reference to the element. | |
| reference | operator() (const int i0, const int i1, const int i2) |
| Return a reference to the element. | |
File I/O. | |
| void | put (std::ostream &out) const |
| Write the ranges to a file stream in ascii format. | |
| void | write (std::ostream &out) const |
| Write to a file stream in binary format. | |
| void | pretty_print (std::ostream &out) const |
| Write to a file stream in a tabular format. | |
Equality. | |
| template<typename T2> | |
| bool | operator== (const ArrayIndexing< N, T2 > &x) const |
| Return true if the ranges are the same. | |
Static Public Member Functions | |
Static members. | |
| static int | rank () |
| Return the rank (number of dimensions) of the array. | |
Protected Member Functions | |
Constructors etc. | |
| ArrayIndexing () | |
| Default constructor. Empty array. | |
| ArrayIndexing (const ArrayIndexing &x) | |
| Copy constructor. Shallow copy. | |
| ArrayIndexing & | operator= (const ArrayIndexing &x) |
| Assignment operator. Shallow assignment. | |
| template<typename Type> | |
| ArrayIndexing (const index_type &extents, Type *data) | |
Construct given the extents and a pointer to the data. | |
| template<typename Type> | |
| void | rebuild (const index_type &extents, Type *data) |
Rebuild given the extents and a pointer to the data. | |
| template<typename Type> | |
| ArrayIndexing (const range_type &ranges, Type *data) | |
Construct given the index ranges and a pointer to the data. | |
| template<typename Type> | |
| void | rebuild (const range_type &ranges, Type *data) |
Rebuild given the index ranges and a pointer to the data. | |
| void | swap (ArrayIndexing &x) |
| Swaps data with another ArrayIndexing. | |
| ~ArrayIndexing () | |
| Destructor. Do nothing. Leave memory management to derived classes. | |
| N | is the dimension. | |
| T | is the value type. By default it is double. |
| typedef types::parameter_type ads::ArrayIndexing< N, T >::parameter_type |
The parameter type.
This is used for passing the value type as an argument.
Reimplemented in ads::Array< N, T, A >, ads::Array< 1, Types::iterator >, and ads::Array< 1, int >.
| typedef types::size_type ads::ArrayIndexing< N, T >::size_type |
The size type is a signed integer.
Having std::size_t (which is an unsigned integer) as the size type causes minor problems. Consult "Large Scale C++ Software Design" by John Lakos for a discussion of using unsigned integers in a class interface.
Reimplemented from ads::ArrayIndexingBase< N >.
Reimplemented in ads::Array< N, T, A >, ads::Array< 1, Types::iterator >, and ads::Array< 1, int >.
| typedef types::unqualified_value_type ads::ArrayIndexing< N, T >::unqualified_value_type |
The unqualified value type.
The value type with top level const and volatile qualifiers removed.
Reimplemented in ads::Array< N, T, A >, ads::Array< 1, Types::iterator >, and ads::Array< 1, int >.
| int ads::ArrayIndexing< N, T >::index | ( | const int | i0, | |
| const int | i1, | |||
| const int | i2 | |||
| ) | const [inline] |
Convert a multi-index to a container index.
Reimplemented from ads::ArrayIndexingBase< N >.
| int ads::ArrayIndexing< N, T >::index | ( | const int | i0, | |
| const int | i1 | |||
| ) | const [inline] |
Convert a multi-index to a container index.
Reimplemented from ads::ArrayIndexingBase< N >.
| void ads::ArrayIndexing< N, T >::index_to_indices | ( | const int | index, | |
| ads::FixedArray< 3, int > & | multi_index | |||
| ) | const [inline] |
Convert a container index to indices in a 3-D array.
Reimplemented from ads::ArrayIndexingBase< N >.
| void ads::ArrayIndexing< N, T >::index_to_indices | ( | const int | index, | |
| ads::FixedArray< 2, int > & | multi_index | |||
| ) | const [inline] |
Convert a container index to indices in a 2-D array.
Reimplemented from ads::ArrayIndexingBase< N >.
| void ads::ArrayIndexing< N, T >::index_to_indices | ( | int | index, | |
| int & | i, | |||
| int & | j, | |||
| int & | k | |||
| ) | const [inline] |
Convert a container index to indices in a 3-D array.
Reimplemented from ads::ArrayIndexingBase< N >.
| void ads::ArrayIndexing< N, T >::index_to_indices | ( | const int | index, | |
| int & | i, | |||
| int & | j | |||
| ) | const [inline] |
Convert a container index to indices in a 2-D array.
Reimplemented from ads::ArrayIndexingBase< N >.
| reference ads::ArrayIndexing< N, T >::operator() | ( | const int | i0, | |
| const int | i1, | |||
| const int | i2 | |||
| ) | [inline] |
Return a reference to the element.
| reference ads::ArrayIndexing< N, T >::operator() | ( | const int | i0, | |
| const int | i1 | |||
| ) | [inline] |
Return a reference to the element.
| parameter_type ads::ArrayIndexing< N, T >::operator() | ( | const ads::FixedArray< 3, int > & | index, | |
| const ads::FixedArray< 3, int > & | offset | |||
| ) | const [inline] |
Return the element specified by the index and offset.
This function avoids constructing an index.
| parameter_type ads::ArrayIndexing< N, T >::operator() | ( | const ads::FixedArray< 2, int > & | index, | |
| const ads::FixedArray< 2, int > & | offset | |||
| ) | const [inline] |
Return the element specified by the index and offset.
This function avoids constructing an index.
| parameter_type ads::ArrayIndexing< N, T >::operator() | ( | const ads::FixedArray< 1, int > & | index, | |
| const ads::FixedArray< 1, int > & | offset | |||
| ) | const [inline] |
Return the element specified by the index and offset.
This function avoids constructing an index.
| parameter_type ads::ArrayIndexing< N, T >::operator() | ( | const int | i0, | |
| const int | i1, | |||
| const int | i2 | |||
| ) | const [inline] |
Return the specified the element.
| parameter_type ads::ArrayIndexing< N, T >::operator() | ( | const int | i0, | |
| const int | i1 | |||
| ) | const [inline] |
Return the specified the element.
| void ads::ArrayIndexing< N, T >::pretty_print | ( | std::ostream & | out | ) | const |
Write to a file stream in a tabular format.
1.4.7