summaryrefslogtreecommitdiff
path: root/modules/codec/tests
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2025-08-30 19:02:15 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2025-08-30 19:04:11 +0200
commita1583da62ea0f7e9affe868cd509557b5e91fae3 (patch)
tree5d5261d24c81f33f81a930bdfc42fe9904915d9e /modules/codec/tests
parent6379fe9ca2cad3d0c9d886e7808b1d579ce349c2 (diff)
Fixing sycldev
Diffstat (limited to 'modules/codec/tests')
-rw-r--r--modules/codec/tests/math.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/codec/tests/math.cpp b/modules/codec/tests/math.cpp
index ad2d9a6..4fb012f 100644
--- a/modules/codec/tests/math.cpp
+++ b/modules/codec/tests/math.cpp
@@ -1,6 +1,7 @@
#include <forstio/test/suite.hpp>
#include "../c++/data.hpp"
#include "../c++/data_math.hpp"
+#include "../c++/math.hpp"
#include "../c++/csv.hpp"
#include <iostream>
@@ -55,4 +56,23 @@ SAW_TEST("Math/Tensor"){
SAW_EXPECT(d.at({{1u,1u}}).get() == 1.0, std::string{"Unexpected value at (1,1): "} + std::to_string(d.at({{1u,1u}}).get()));
}
}
+
+SAW_TEST("Math/Dot"){
+ 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()) );
+}
}