From f992a6afc4e99691cf70186cf07031ed1f65096e Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 23 Sep 2025 17:08:11 +0200 Subject: Fixed a bug in normalization --- modules/codec/tests/math.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'modules/codec/tests/math.cpp') diff --git a/modules/codec/tests/math.cpp b/modules/codec/tests/math.cpp index 4fb012f..cc371dd 100644 --- a/modules/codec/tests/math.cpp +++ b/modules/codec/tests/math.cpp @@ -75,4 +75,23 @@ SAW_TEST("Math/Dot"){ SAW_EXPECT(c.at({}).get() == 3.0, std::string{"Unexpected value for dot product "} + std::to_string(c.at({}).get()) ); } + +SAW_TEST("Math/Tensor Mult Scalar"){ + using namespace saw; + + data> a; + { + a.at({{0u}}) = 2.0; + a.at({{1u}}) = 1.0; + } + data> b; + { + b.at({{0u}}) = -1.0; + b.at({{1u}}) = 5.0; + } + + auto c = math::dot(a,b); + + SAW_EXPECT(c.at({}).get() == 3.0, std::string{"Unexpected value for dot product "} + std::to_string(c.at({}).get()) ); +} } -- cgit v1.2.3