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

#include <permutations.h>

Public Member Functions

 Combinations (std::span< T > values, size_t r)
 
bool next ()
 
auto begin () const
 
auto end () const
 

Detailed Description

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

Generate r length subsequences of elements from the input values.

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

Example:

std::array values = {0, 1, 2};
util::Combinations comb(std::span{values}, 2);
do {
for (auto v : comb) {
std::cout << v << " ";
}
std::cout << "\n";
} while (comb.next());
Definition permutations.h:139

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