lite::s_iterator Class Reference
[Array Internals (Advanced)]

An s_iterator is used to represent a general multidimensional strided iterator using a stl style iterator and stride lengths for each dimension. More...

#include <array.hpp>


Detailed Description

An s_iterator is used to represent a general multidimensional strided iterator using a stl style iterator and stride lengths for each dimension.

The s_iterator is not actually a separate class or type. It is represented by a lite::pack object. The first element of the pack (element 0) stores a pointer or another type of stl style iterator. The elements 1 to N store the stride values for the dimensions 1 to N respectively. The type of each of the stride elements is:

All the required operations (i.e. at(), inc(), dec(), shift()) are also defined.

For example:

        array<float[3][4][5]> a;

        // Below is the actual type of the iterator for array a
        pack<float*, constant<int, 20>, constant<int, 5>, constant<int, 1> > it_a;  
        
        it_a = a.begin();
        at(it_a, 1, 2, 3) = -1;
        // the previous line is equivalent to:
        a(1, 2, 3) = -1;

        array<float[1][1][5]> b(3, 4, 5);

        // Below is the actual type of the iterator for array b
        pack<float*, int, constant<int, 5>, constant<int, 1> > it_b = b.begin();

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Defines

Generated on Fri Nov 6 02:03:22 2009 for Lite by  doxygen 1.6.0