BZDEV: Array iterators

From: tveldhui (tveldhui@extreme.indiana.edu)
Date: Thu Jan 14 1999 - 16:48:16 EST


Array iterators are now working, and will appear in the next
snapshot. Here's the relevant documentation for Array member
functions:

bf(verb(\
Array<T,N>::iterator begin();
Array<T,N>::const_iterator begin() const;
))
These functions return STL-style forward and
input iterators, respectively, positioned at the first
element of the array. Note that the array data
is traversed in memory order (i.e. by rows for C-style
arrays, and by columns for Fortran-style arrays).
The tt(Array<T,N>::const_iterator) has these methods:
verb(\
    const_iterator(const Array<T,N>&);
    T operator*() const;
    const T* [restrict] operator->() const;
    const_iterator& operator++();
    void operator++(int);
    bool operator==(const const_iterator<T,N>&) const;
    bool operator!=(const const_iterator<T,N>&) const;
    const TinyVector<int,N>& position() const;
)
Note that postfix ++ returns void (this is not STL-compliant,
but is done for efficiency). The method tt(position()) returns
a vector containing current index positions of the iterator.
The tt(Array<T,N>::iterator) has the same methods as
tt(const_iterator), with these exceptions:
verb(\
    iterator& operator++();
    T& operator*();
    T* [restrict] operator->();
)
The tt(iterator) type may be used to modify array elements.
To obtain iterator positioned at the end of the array,
use the tt(end()) methods.

   ....

bf(verb(\
Array<T,N>::iterator end();
Array<T,N>::const_iterator end() const;
))
Returns STL-style forward and input iterators (respectively)
for the array, positioned at the end of the array.

--------------------- blitz-dev list --------------------------------
* To subscribe/unsubscribe: mail to majordomo@oonumerics.org, with
"subscribe blitz-dev" or "unsubscribe blitz-dev" in the body of the message
* Blitz++ web page: http://oonumerics.org/blitz/



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 04:30:08 EST