From 0cac37e9f6062090b22d5ef8c19517a451176f33 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 23 Sep 2025 17:47:03 +0200 Subject: Obviously this should be generalized --- modules/codec/c++/math.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/codec/c++/math.hpp b/modules/codec/c++/math.hpp index ca43dd0..c7da99e 100644 --- a/modules/codec/c++/math.hpp +++ b/modules/codec/c++/math.hpp @@ -35,8 +35,9 @@ data, Encoding> normalize(const data>& i auto sqrt_inp_dot = sqrt(inp_dot); saw::data, Encoding> out; - out.at({{0u}}).set(input.at({{0u}}).get() / sqrt_inp_dot.at({}).get()); - out.at({{1u}}).set(input.at({{1u}}).get() / sqrt_inp_dot.at({}).get()); + for(uint64_t i = 0u; i < D; ++i){ + out.at({{i}}).set(input.at({{i}})).get() / sqrt_inp_dot.at({}).get()); + } return out; } } -- cgit v1.2.3