diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-09-23 17:47:03 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-09-23 17:47:03 +0200 |
| commit | 0cac37e9f6062090b22d5ef8c19517a451176f33 (patch) | |
| tree | 540bf20f35182573e877b8de7bdefbe23feff9bc /modules/codec | |
| parent | f992a6afc4e99691cf70186cf07031ed1f65096e (diff) | |
| download | forstio-forstio-0cac37e9f6062090b22d5ef8c19517a451176f33.tar.gz | |
Obviously this should be generalized
Diffstat (limited to 'modules/codec')
| -rw-r--r-- | modules/codec/c++/math.hpp | 5 |
1 files 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<schema::Vector<T,D>, Encoding> normalize(const data<schema::Vector<T,D>>& i auto sqrt_inp_dot = sqrt<T>(inp_dot); saw::data<schema::Vector<T,D>, 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; } } |
