diff options
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()) ); +} } |