27constexpr inline void noop_projector(
unsigned,
int) {}
30concept IndexVectorConcept =
requires(T
vector) {
31 {
vector[0] } -> std::convertible_to<std::size_t>;
52template <
class Kernel,
class Projector = decltype(detail::noop_projector)>
53 requires std::invocable<Kernel> and std::invocable<Projector, unsigned, int>
55 detail::IndexVectorConcept
auto &&stop,
56 detail::IndexVectorConcept
auto &&counters, Kernel &&kernel,
57 Projector &&projector = detail::noop_projector) {
58 auto &nx = counters[0u];
59 auto &ny = counters[1u];
60 auto &nz = counters[2u];
61 for (nx = start[0u]; nx < stop[0u]; ++nx) {
63 for (ny = start[1u]; ny < stop[1u]; ++ny) {
65 for (nz = start[2u]; nz < stop[2u]; ++nz) {
and std::invocable< Projector, unsigned, int > void for_each_3d(detail::IndexVectorConcept auto &&start, detail::IndexVectorConcept auto &&stop, detail::IndexVectorConcept auto &&counters, Kernel &&kernel, Projector &&projector=detail::noop_projector)
Repeat an operation on every element of a 3D grid.
std::vector< T, allocator< T > > vector