8 #ifndef __DIADES__UTILS__DISPATCHER__HH 9 #define __DIADES__UTILS__DISPATCHER__HH 48 template<
long unsigned int Size>
54 using Array = std::array<unsigned, Size>;
70 if (_current.size() > 1) {
73 _current[_stack.size() - 2] = _stack.top().first;
91 while (!_stack.empty()) {
100 auto tempPair = _stack.top();
101 _current[_stack.size() - 2] = 0;
103 _stack.push({tempPair.first - 1, tempPair.second + 1});
104 if (_stack.size() == _current.size() + 1) {
110 while (_stack.top().first == 0) {
113 tempPair = _stack.top();
115 _stack.push({tempPair.first - 1, tempPair.second + 1});
117 _current[_stack.size() - 2] = _stack.top().first;
118 _stack.push({tempPair.second + 1, 0});
119 _current[_stack.size() - 2] = _stack.top().first;
130 return !(_stack.empty() || ((_stack.size() == _current.size() + 1) && (_stack.top().first == _n)));
138 return _current.size() == 0;
155 const long unsigned int size()
const 175 std::stack< std::pair<unsigned, unsigned> >
_stack;
std::stack< std::pair< unsigned, unsigned > > _stack
std::array< unsigned, Size > Array
Namespace of the Diades project.
unsigned nbElements() const
const long unsigned int size() const