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

#include <inviwo/core/algorithm/permutations.h>

Public Member Functions

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

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:
  • include/inviwo/core/algorithm/permutations.h