Public Member Functions
Subiterator< Iterator > Class Template Reference

Subvector iterator class provides striding iterators. More...

#include <subiterator.h>

Public Member Functions

 Subiterator (const Iterator &iter, const difference_type &stride=1)
 Constructors. More...

Detailed Description

template<typename Iterator>
class LinBox::Subiterator< Iterator >

Subvector iterator class provides striding iterators.

A Subiterator steps by a fixed stride thru the underlying container. Subiter<Iterator> requires that Iterator be a random access iterator class and then itself provides the full functionality of a random access iterator class. See STL documentation for that functionality. Documented here is only the constructor from (1) an iterator of an underlying container and (2) a stride amount.

Constructor & Destructor Documentation

Subiterator ( const Iterator &  iter,
const difference_type &  stride = 1 


Subiterator p (pp, 3) provides an iterator which initially has the same reference, but for which increments and offsets step by the amount stride rather than 1. Thus p+k is equivalent to pp+(stride*k).

Striding iterators are easily positioned beyond the bounds of the underlying container. It is up to the user to dereference the iterator only when it has a valid reference.

The documentation for this class was generated from the following file: