summaryrefslogtreecommitdiff
path: root/c++/descriptor.h
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2023-09-02 18:04:18 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2023-09-02 18:04:18 +0200
commitf3dde8285baf87a89d2a9b79ac719573c47538ff (patch)
treecc023cb0486601f14a0f0523e0c49ebd0d06c5f7 /c++/descriptor.h
parent0ba2bc42e7ffaf71983dc9a8a1c59853c50a2cc2 (diff)
c++: Generating example layouts
Diffstat (limited to 'c++/descriptor.h')
-rw-r--r--c++/descriptor.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/c++/descriptor.h b/c++/descriptor.h
index 4d29831..33fef9b 100644
--- a/c++/descriptor.h
+++ b/c++/descriptor.h
@@ -1,6 +1,6 @@
#pragma once
-#include <forstio/codec/schema.h>
+#include <forstio/codec/data.h>
namespace kel {
namespace lbm {
@@ -32,24 +32,24 @@ template<typename T>
class df_info{};
template<typename T>
-class df_info<Descriptor<T, 2, 5>> {
- static constexpr std::array<std::array<int32_t, 2>, 5> directions = {
+class df_info<schema::Descriptor<T, 2, 5>> {
+ static constexpr std::array<std::array<int32_t, 2>, 5> directions = {{
{ 0, 0},
{-1, 0},
{ 0,-1},
{ 0, 1},
{ 1, 0}
+ }};
+
+ static constexpr std::array<typename saw::native_data_type<T>::type,5> weights = {
+ 1./3.,
+ 1./6.,
+ 1./6.,
+ 1./6.,
+ 1./6.
};
- static constexpr std::array<std::ratio<int32_t>,5> weights = {
- {1,3},
- {1,6},
- {1,6},
- {1,6},
- {1,6}
- };
-
- static constexpr std::ratio<int32_t> cs2 = {1,3};
+ static constexpr typename saw::native_data_type<T>::type cs2 = 1./3.;
};
}
}