TRIQS/itertools 1.3.0
C++ range library
|
An integer range is similar to a Python range
.
It is defined by a start value, an end value and a step size such that the i-th value of the range is given by start + i * step
.
Classes | |
class | itertools::range |
A lazy range of integers that mimics a Python range. More... | |
struct | itertools::range::all_t |
Denote a full range at compile-time. More... | |
struct | itertools::range::const_iterator |
Const iterator type for itertools::range. More... | |
Functions | |
template<typename F > | |
void | itertools::foreach (range const &rg, F &&f) |
Apply a function to every element of an integer itertools::range. | |
template<typename... Is, typename EnableIf = std::enable_if_t<(std::is_integral_v<Is> and ...), int>> | |
auto | itertools::product_range (Is... is) |
Create a cartesian product range of integer ranges from given integers. | |
template<typename I , size_t N, typename EnableIf = std::enable_if_t<std::is_integral_v<I>, int>> | |
auto | itertools::product_range (std::array< I, N > const &idx_arr) |
Create a cartesian product range of integer ranges from an array of integers. | |
template<typename... Is, typename EnableIf = std::enable_if_t<(std::is_integral_v<Is> and ...), int>> | |
auto | itertools::product_range (std::tuple< Is... > const &idx_tpl) |
Create a cartesian product range of integer ranges from a tuple of integers. | |
void itertools::foreach | ( | range const & | rg, |
F && | f ) |
#include <itertools/range.hpp>
Apply a function to every element of an integer itertools::range.
Output:
F | Callable type. |
rg | itertools::range object. |
f | Callable object to be applied to each element. |
|
nodiscard |
#include <itertools/range.hpp>
Create a cartesian product range of integer ranges from given integers.
The given integers specify the excluded last values of the individual itertools::range objects. Each range starts at 0 and has a step size of 1.
Output:
Is | Integer types. |
is | Last values of the integer ranges (excluded). |
|
nodiscard |
#include <itertools/range.hpp>
Create a cartesian product range of integer ranges from an array of integers.
The integers in the given array specify the excluded last values of the individual itertools::range objects. Each range starts at 0 and has a step size of 1.
Output:
I | Integer type. |
N | Number of elements in the array. |
idx_arr | Array containing the excluded last values of the integer ranges. |
|
nodiscard |
#include <itertools/range.hpp>
Create a cartesian product range of integer ranges from a tuple of integers.
The integers in the given tuple specify the excluded last values of the individual itertools::range objects. Each range starts at 0 and has a step size of 1.
Output:
Is | Integer types. |
idx_tpl | Tuple containing the excluded last values of the integer ranges. |