abstract class
Phase::StrideIterator(I)
- Phase::StrideIterator(I)
- Reference
- Object
Overview
A coordinate iterator that advances to the next value by taking orthogonal strides. The only iteration orders that obey that criteria are lexicographic, colexicographic, and their reverses.
Included Modules
- Iterator(Indexable(I))
Direct Known Subclasses
- Phase::Buffered::Indexed::StrideIterator(I)
- Phase::ColexIterator(I)
- Phase::LexIterator(I)
- Phase::MultiIndexable::TilingLexIterator(I)
Defined in:
iterators/stride_iterator.crConstructors
-
.new(idx_r : IndexRegion(I))
Constructs an iterator that will provide every coordinate described by an
IndexRegion. -
.new(region_literal : Indexable(I)) forall I
Constructs an iterator that will provide every coordinate described by a region literal.
Class Method Summary
-
.cover(shape : Indexable(I)) forall I
Constructs an iterator that will provide every coordinate within
shape. -
.cover(src : MultiIndexable)
Constructs an iterator that will provide every coordinate in
src.shape.
Macro Summary
Instance Method Summary
-
#advance! : Array(I) | Stop
Advances the internal state of this
StrideIteratorand returns the new coord (orIterator::Stopif iteration is finished). -
#largest_coord : Indexable(I) | Nil
Returns a coordinate that stores the largest possible value this
StrideIteratorcan output in each ordinate. -
#next : ReadonlyWrapper(Array(I), I) | Stop
Returns the next element in this iterator, or
Iterator::Stop::INSTANCEif there are no more elements. - #reset!
-
#reverse!
Reverses the direction of iteration in-place.
-
#to_a : Array(Indexable(I))
Returns an ordered
Arrayof all coordinates thisStrideIteratorwill cover. -
#unsafe_next : Indexable(I)
Returns
#nexttypecast to anIndexable(I).
Constructor Detail
Constructs an iterator that will provide every coordinate described by an IndexRegion.
Constructs an iterator that will provide every coordinate described by a region literal.
Class Method Detail
Constructs an iterator that will provide every coordinate within shape.
Constructs an iterator that will provide every coordinate in src.shape.
Macro Detail
Instance Method Detail
Advances the internal state of this StrideIterator and returns the new coord (or Iterator::Stop if iteration is finished).
Returns a coordinate that stores the largest possible value this StrideIterator can output in each ordinate.
If there are no coordinates contained in this IndexRegion (e.g. IndexRegion[0...0]),
returns null.
Returns the next element in this iterator, or Iterator::Stop::INSTANCE if there
are no more elements.
Returns an ordered Array of all coordinates this StrideIterator will cover.