diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-09-23 17:08:11 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-09-23 17:08:11 +0200 |
commit | f992a6afc4e99691cf70186cf07031ed1f65096e (patch) | |
tree | 7113e19b1c77e96f24ddfce738390bdd20da1885 /modules/codec/tests | |
parent | 469fe4084787d00a9ab10f00204f7e766ed68161 (diff) |
Diffstat (limited to 'modules/codec/tests')
-rw-r--r-- | modules/codec/tests/math.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
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<sch::Vector<sch::Float64, 2u>> a; + { + a.at({{0u}}) = 2.0; + a.at({{1u}}) = 1.0; + } + data<sch::Vector<sch::Float64, 2u>> 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()) ); +} } |