From c0549d71b2109f10c1238db8b22362e7826ba61b Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sun, 5 Jul 2026 15:59:23 +0200 Subject: Just rename from lib to modules --- modules/core/c++/index.hpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 modules/core/c++/index.hpp (limited to 'modules/core/c++/index.hpp') diff --git a/modules/core/c++/index.hpp b/modules/core/c++/index.hpp new file mode 100644 index 0000000..00e597e --- /dev/null +++ b/modules/core/c++/index.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include "common.hpp" + +namespace kel { +namespace lbm { + +template +saw::data> lower_index_from_pos(const saw::data>& pos){ + saw::data> ind; + + for(saw::data i{0u}; i < ind.size(); ++i){ + ind.at(i).set(std::max(pos.at(i).template cast_to().get(),0)); + } + + return ind; +} + +template +saw::data> upper_index_from_pos(const saw::data>& pos){ + auto ind = lower_index_from_pos(pos); + + for(saw::data i{0u}; i < ind.size(); ++i){ + ++ind.at(i); + } + return ind; +} + +} +} -- cgit v1.2.3