Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::util::IndexProduct< T > Class Template Reference

#include <permutations.h>

Public Member Functions

 IndexProduct (std::span< T > sizes)
 
bool next ()
 
auto begin () const
 
auto end () const
 

Detailed Description

template<typename T>
class inviwo::util::IndexProduct< T >

Generate r length subsequences of elements from the input values.

See also
https://docs.python.org/3/library/itertools.html#itertools.product

Example:

std::array sizes = {3, 2};
util::IndexProduct inds(std::span{sizes}, 2);
do {
for (auto v : inds) {
std::cout << v << " ";
}
std::cout << "\n";
} while (inds.next());
Definition permutations.h:196

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