Round-robin index generator over a half-open range [lo, hi)
More...
#include <round_robin.hpp>
|
| | RoundRobin () |
| | Default-construct (uninitialized; reassign before use)
|
| |
| | RoundRobin (std::size_t hi) |
| | Round-robin over [0, hi)
|
| |
| | RoundRobin (std::size_t lo, std::size_t hi) |
| | Round-robin over [lo, hi)
|
| |
| auto | next () -> std::size_t |
| | Advance to the next index and return it.
|
| |
Round-robin index generator over a half-open range [lo, hi)
Successive calls to next() yield lo, lo+1, ..., hi-1, lo, ... Used to scan constraints cyclically (e.g. ProfitOracle, LowpassOracle). The first call to next() returns lo, matching the ++idx; if (idx == N) idx = 0; idiom it replaces.
◆ RoundRobin() [1/3]
| RoundRobin::RoundRobin |
( |
| ) |
|
|
inline |
Default-construct (uninitialized; reassign before use)
◆ RoundRobin() [2/3]
| RoundRobin::RoundRobin |
( |
std::size_t |
hi | ) |
|
|
inlineexplicit |
◆ RoundRobin() [3/3]
| RoundRobin::RoundRobin |
( |
std::size_t |
lo, |
|
|
std::size_t |
hi |
|
) |
| |
|
inline |
Round-robin over [lo, hi)
◆ next()
| auto RoundRobin::next |
( |
| ) |
-> std::size_t |
|
inline |
Advance to the next index and return it.
The documentation for this class was generated from the following file: