symbolic
Classes | Public Types | Public Member Functions | List of all members
symbolic::CombinationGenerator< ContainerT > Class Template Reference

#include <combination_generator.h>

Public Types

using iterator = typename std::conditional_t< std::is_const< ContainerT >::value, Iterator< true >, Iterator< false > >
 
using const_iterator = Iterator< true >
 
using reverse_iterator = ReverseIterator< iterator >
 
using const_reverse_iterator = ReverseIterator< const_iterator >
 

Public Member Functions

 CombinationGenerator (const std::vector< ContainerT * > &options)
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
size_t size () const
 
bool empty () const
 
iterator::value_type at (int i) const
 
iterator::value_type operator[] (int i) const
 
int find (const typename iterator::value_type &combination) const
 

Detailed Description

template<typename ContainerT>
class symbolic::CombinationGenerator< ContainerT >

Class for generating all combinations of a collection of sequences.

This class contains no mutable member variables. All the state is held inside the iterator, meaning multiple parallel instances can use the same generator simultaneously.

Assumes that each option has at least one element.

Member Function Documentation

◆ at()

template<typename ContainerT >
iterator::value_type symbolic::CombinationGenerator< ContainerT >::at ( int  i) const
inline

Access specified element with wrapping and bounds checking.

◆ empty()

template<typename ContainerT >
bool symbolic::CombinationGenerator< ContainerT >::empty ( ) const
inline

Whether this combination generator is empty.

◆ find()

template<typename ContainerT >
int symbolic::CombinationGenerator< ContainerT >::find ( const typename iterator::value_type &  combination) const
inline

Get index of given combination.

◆ operator[]()

template<typename ContainerT >
iterator::value_type symbolic::CombinationGenerator< ContainerT >::operator[] ( int  i) const
inline

Access specified element without bounds checking.

◆ size()

template<typename ContainerT >
size_t symbolic::CombinationGenerator< ContainerT >::size ( ) const
inline

Number of total combinations.


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