diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-10-29 18:24:21 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-10-29 18:24:21 +0100 |
| commit | f8f210993fe199c40df63827c8b1ae0257b02753 (patch) | |
| tree | 93b0c81ea5288962216361f36d03415807396f37 /lib/tests/iterator.cpp | |
| parent | ff5785145d08b6a8fc5ab07caab441ed5ccfb2dd (diff) | |
| download | libs-lbm-master.tar.gz | |
Diffstat (limited to 'lib/tests/iterator.cpp')
| -rw-r--r-- | lib/tests/iterator.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/tests/iterator.cpp b/lib/tests/iterator.cpp index cd1cb7c..261765a 100644 --- a/lib/tests/iterator.cpp +++ b/lib/tests/iterator.cpp @@ -9,7 +9,7 @@ namespace sch { using namespace kel::lbm::sch; } -SAW_TEST("Iterate"){ +SAW_TEST("Old Iterate"){ using namespace kel; saw::data<sch::FixedArray<sch::UInt64,2u>> start{{0u,0u}}; @@ -20,7 +20,7 @@ SAW_TEST("Iterate"){ }, start, end); } -SAW_TEST("Iterate with Distance 1"){ +SAW_TEST("Old Iterate with Distance 1"){ using namespace kel; saw::data<sch::FixedArray<sch::UInt64,2u>> start{{0u,0u}}; @@ -30,4 +30,26 @@ SAW_TEST("Iterate with Distance 1"){ std::cout<<"Index: "<<index.at({0u}).get()<<" "<<index.at({1u}).get()<<std::endl; }, start, end, {{1u,1u}}); } + +SAW_TEST("Iterate - 2D"){ + using namespace kel; + + saw::data<sch::FixedArray<sch::UInt64,2u>> start{{0u,0u}}; + saw::data<sch::FixedArray<sch::UInt64,2u>> end{{3u,3u}}; + + lbm::iterator<2u>::apply([](const saw::data<sch::FixedArray<sch::UInt64,2u>>& index){ + std::cout<<"Index: "<<index.at({0u}).get()<<" "<<index.at({1u}).get()<<std::endl; + }, start, end); +} + +SAW_TEST("Iterate with Distance 1 - 2D"){ + using namespace kel; + + saw::data<sch::FixedArray<sch::UInt64,2u>> start{{0u,0u}}; + saw::data<sch::FixedArray<sch::UInt64,2u>> end{{4u,4u}}; + + lbm::iterator<2u>::apply([](const saw::data<sch::FixedArray<sch::UInt64,2u>>& index){ + std::cout<<"Index: "<<index.at({0u}).get()<<" "<<index.at({1u}).get()<<std::endl; + }, start, end, {{1u,1u}}); +} } |
