From 16c1198f8fb401c3a98d927053fb2d29c2ce5f91 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 20 Mar 2026 18:17:55 +0100 Subject: Too much time spent on downcasts, but well. Here I am. --- lib/core/tests/math.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'lib/core/tests') diff --git a/lib/core/tests/math.cpp b/lib/core/tests/math.cpp index 738d637..7c9dc14 100644 --- a/lib/core/tests/math.cpp +++ b/lib/core/tests/math.cpp @@ -1,5 +1,6 @@ #include +#include #include "../c++/math/n_linear.hpp" namespace { @@ -7,13 +8,34 @@ namespace sch { using namespace saw::schema; } -SAW_TEST("Math 2-Linear"){ +SAW_TEST("Math 1-Linear"){ using namespace kel; + + saw::data,2u>> field; + { + field.at({{0u}}).at({{0u}}).set(-1.0); + field.at({{1u}}).at({{0u}}).set(2.0); + } + saw::data> pos; + pos.at({{0u}}).set(0.3); +} - saw::data,32u,32u>> field; +SAW_TEST("Math/Floor Index from Pos"){ + using namespace kel; saw::data> pos; + { + pos.at({{0u}}) = 43.999; + pos.at({{1u}}) = -50.0; + } + + auto ind = lbm::floor_index_from_position(pos); + for(uint64_t i = 0u; i < 2u; ++i){ + std::cout<