diff options
Diffstat (limited to 'c++/iterator.hpp')
-rw-r--r-- | c++/iterator.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/c++/iterator.hpp b/c++/iterator.hpp new file mode 100644 index 0000000..01163cf --- /dev/null +++ b/c++/iterator.hpp @@ -0,0 +1,18 @@ +#pragma once + +#include "descriptor.hpp" + +namespace kel { +namespace lbm { +template<typename Func> +void iterate_over(Func&& func, const saw::data<sch::FixedArray<sch::UInt64,2u>>& start, const saw::data<sch::FixedArray<sch::UInt64,2u>>& end, const saw::data<sch::UInt64>& dist = {0u}){ + // static_assert(D == 2u, "Currently a lazy implementation for AND combinations of intervalls."); + for(saw::data<sch::UInt64> i{start.at({0u}) + dist}; (i+dist) < end.at({0u}); ++i){ + for(saw::data<sch::UInt64> j{start.at({0u}) + dist}; (j+dist) < end.at({1u}); ++j){ + func({{i,j}}); + } + } + return; +} +} +} |