ALP User Documentation
0.8.preview
Algebraic Programming User Documentation
|
Collects various useful STL-compatible iterators. More...
Classes | |
class | Adapter |
An iterator that simply adapts the values returned by another iterator. More... | |
class | IteratorFilter |
This iterator filters elements from another iterator based on a user- specified filter function. More... | |
class | Repeater |
An iterator that repeats the same value for a set number of times. More... | |
class | Sequence |
An iterator over a collection of \( c \) items that for each item \( i \in \{0,1,\dots,c-1\} \) returns \( f(i) \), where \( f \) is of the form \( o + s( \lfloor i/r \rfloor ) \). More... | |
Functions | |
template<typename SubIterT > | |
static Adapter< SubIterT > | make_adapter_iterator (const SubIterT start, const SubIterT end, const std::function< typename SubIterT::value_type(const typename SubIterT::value_type) > func) |
Creates an adapter of a given iterator. More... | |
template<typename FwdSubIter > | |
IteratorFilter< FwdSubIter > | make_filtered_iterator (FwdSubIter begin, const FwdSubIter end, const std::function< bool(const typename FwdSubIter::value_type &) > func) |
The factory function that takes any iterator pair over the same container and returns a filtered iterator. More... | |
Collects various useful STL-compatible iterators.
|
static |
Creates an adapter of a given iterator.
SubIterT | The type of the given iterator. |
Only random random access iterators are currently supported.
[in] | start | The given iterator whose values shall be adapted. |
[in] | end | The end-iterator that matches start. |
[in] | func | The function by which the values of the given iterator shall be adapted. The function must take a single const value of the iterator value type, and shall return the modified value type. |
The returned iterator is a const-iterator, meaning the values iterated over cannot be modified– even if the original iterator supported this.
The iterator adapter does not support changing the original value type of the underlying start and end iterators. If such functionality would be useful, please submit a feature request.
IteratorFilter< FwdSubIter > make_filtered_iterator | ( | FwdSubIter | begin, |
const FwdSubIter | end, | ||
const std::function< bool(const typename FwdSubIter::value_type &) > | func | ||
) |
The factory function that takes any iterator pair over the same container and returns a filtered iterator.
[in] | begin | An iterator over the same container as end. |
[in] | end | An iterator over the same container as begin in end position. |
[in] | func | Values between begin and end for which this function evaluates true shall not be iterated over by the returned IteratorFilter instances. |
false
or equals end.