OmniSciDB
a5dc49c757
|
#include <CartesianProduct.h>
Public Member Functions | |
CartesianProductIterator ()=delete | |
Delete default constructor. More... | |
CartesianProductIterator (T const &structure, std::size_t pos) | |
Constructor setting the underlying iterator and position. More... | |
Private Types | |
using | OuterContainer = T |
Give types more descriptive names. More... | |
using | Container = typename T::value_type |
using | Content = typename T::value_type::value_type |
Private Member Functions | |
void | increment () |
Increment iterator. More... | |
bool | equal (CartesianProductIterator< T > const &other) const |
Check for equality. More... | |
std::vector< Content > const & | dereference () const |
Dereference iterator. More... | |
Private Attributes | |
OuterContainer const & | structure_ |
The part we are iterating over. More... | |
std::vector< typename Container::const_iterator > | position_ |
The position in the Cartesian product. More... | |
std::size_t | absolutePosition_ = 0 |
The position just indexed by an integer. More... | |
std::vector< typename Container::const_iterator > | cbegins_ |
The begin iterators, saved for convenience and performance. More... | |
std::vector< typename Container::const_iterator > | cends_ |
The end iterators, saved for convenience and performance. More... | |
std::vector< std::vector < Content > > | result_ {std::vector<Content>()} |
Used for returning references. More... | |
std::size_t | size_ = 0 |
The size of the instance of OuterContainer. More... | |
Friends | |
class | boost::iterator_core_access |
Grant access to boost::iterator_facade. More... | |
Class iterating over the Cartesian product of a forward iterable container of forward iterable containers
Definition at line 30 of file CartesianProduct.h.
|
private |
Definition at line 51 of file CartesianProduct.h.
|
private |
Definition at line 52 of file CartesianProduct.h.
|
private |
Give types more descriptive names.
Definition at line 50 of file CartesianProduct.h.
|
delete |
Delete default constructor.
|
explicit |
Constructor setting the underlying iterator and position.
[in] | structure | The underlying structure |
[in] | pos | The position the iterator should be initialized to. std::numeric_limits<std::size_t>::max()stands for the end, the position after the last element. |
Definition at line 99 of file CartesianProduct.h.
References CartesianProductIterator< T >::absolutePosition_, CartesianProductIterator< T >::cbegins_, CartesianProductIterator< T >::cends_, CartesianProductIterator< T >::increment(), CartesianProductIterator< T >::position_, CartesianProductIterator< T >::size_, and CartesianProductIterator< T >::structure_.
|
private |
Dereference iterator.
Definition at line 157 of file CartesianProduct.h.
References run_benchmark_import::result.
|
private |
Check for equality.
Definition at line 173 of file CartesianProduct.h.
References CartesianProductIterator< T >::absolutePosition_, and CartesianProductIterator< T >::structure_.
|
private |
Increment iterator.
Definition at line 131 of file CartesianProduct.h.
Referenced by CartesianProductIterator< T >::CartesianProductIterator().
|
friend |
Grant access to boost::iterator_facade.
Definition at line 56 of file CartesianProduct.h.
|
private |
The position just indexed by an integer.
Definition at line 79 of file CartesianProduct.h.
Referenced by CartesianProductIterator< T >::CartesianProductIterator(), and CartesianProductIterator< T >::equal().
|
private |
The begin iterators, saved for convenience and performance.
Definition at line 82 of file CartesianProduct.h.
Referenced by CartesianProductIterator< T >::CartesianProductIterator().
|
private |
The end iterators, saved for convenience and performance.
Definition at line 85 of file CartesianProduct.h.
Referenced by CartesianProductIterator< T >::CartesianProductIterator().
|
private |
The position in the Cartesian product.
For each element of structure_, give the position in it. The empty vector represents the end position. Note that this vector has a size equal to structure->size(), or is empty.
Definition at line 76 of file CartesianProduct.h.
Referenced by CartesianProductIterator< T >::CartesianProductIterator().
|
mutableprivate |
Used for returning references.
We initialize with one empty element, so that we only need to add more elements in increment().
Definition at line 92 of file CartesianProduct.h.
|
private |
The size of the instance of OuterContainer.
Definition at line 95 of file CartesianProduct.h.
Referenced by CartesianProductIterator< T >::CartesianProductIterator().
|
private |
The part we are iterating over.
Definition at line 68 of file CartesianProduct.h.
Referenced by CartesianProductIterator< T >::CartesianProductIterator(), and CartesianProductIterator< T >::equal().