summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-04-15 19:11:42 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-04-15 19:11:42 +0200
commit6d4dbbd5cafce3435ca4c7aae020ba17e5a89b87 (patch)
treebcf93a7e475dff5b1a7797a271c94d1a45782c37
parentb1a45e4e1c7ef45b95316443f67c8904a9d5b959 (diff)
downloadforstio-forstio-6d4dbbd5cafce3435ca4c7aae020ba17e5a89b87.tar.gz
Dangling changes and added cross productHEADmasterdev
-rw-r--r--modules/codec/c++/data.hpp2
-rw-r--r--modules/codec/c++/math.hpp15
-rw-r--r--modules/codec/c++/schema_meta.hpp18
3 files changed, 24 insertions, 11 deletions
diff --git a/modules/codec/c++/data.hpp b/modules/codec/c++/data.hpp
index 6a796f5..217a53f 100644
--- a/modules/codec/c++/data.hpp
+++ b/modules/codec/c++/data.hpp
@@ -657,9 +657,7 @@ class data<schema::Array<T,Dim>, encode::Native> {
uint64_t s = 1;
for(uint64_t iter = 0; iter < Dim; ++iter){
-
auto& dim_iter = dims_.at(data<schema::UInt64>{iter});
-
s *= dim_iter.get();
}
diff --git a/modules/codec/c++/math.hpp b/modules/codec/c++/math.hpp
index 2ce8333..1d627e6 100644
--- a/modules/codec/c++/math.hpp
+++ b/modules/codec/c++/math.hpp
@@ -141,6 +141,21 @@ data<schema::Scalar<T>,Encoding> cross(
}
template<typename T, typename Encoding = FORSTIO_DEFAULT_DATA_ENCODING>
+data<schema::Vector<T,2u>,Encoding> cross(
+ const data<schema::Scalar<T>, Encoding> lh,
+ const data<schema::Vector<T,2u>, Encoding> rh
+){
+ data<schema::Vector<T,2u>, Encoding> cross_prod;
+
+ cross_prod.at({{0u}}) = lh.at({}) * rh.at({{1u}}) * -1;
+ cross_prod.at({{1u}}) = lh.at({}) * rh.at({{0u}});
+
+ return cross_prod;
+}
+
+
+
+template<typename T, typename Encoding = FORSTIO_DEFAULT_DATA_ENCODING>
data<schema::Scalar<T>,Encoding> cos(
const data<schema::Scalar<T>,Encoding>& val
){
diff --git a/modules/codec/c++/schema_meta.hpp b/modules/codec/c++/schema_meta.hpp
index ff66bbb..efa486d 100644
--- a/modules/codec/c++/schema_meta.hpp
+++ b/modules/codec/c++/schema_meta.hpp
@@ -23,8 +23,8 @@ struct meta_schema<schema::Bool> {
template<typename T, uint64_t N>
struct meta_schema<schema::Primitive<T,N>> {
- using MetaSchema = schema::Void;
using Schema = schema::Primitive<T,N>;
+ using MetaSchema = schema::Void;
};
template<typename TA, uint64_t NA, typename TB, uint64_t NB>
@@ -35,38 +35,38 @@ struct meta_schema<schema::MixedPrecision<schema::Primitive<TA,NA>, schema::Prim
template<typename T>
struct meta_schema<schema::Ref<T>> {
- using MetaSchema = schema::Void;
using Schema = schema::Ref<T>;
+ using MetaSchema = schema::Void;
};
template<typename Key, typename Value>
struct meta_schema<schema::Map<Key,Value>> {
- using MetaSchema = schema::Void;
using Schema = schema::Map<Key,Value>;
+ using MetaSchema = schema::Void;
};
template<typename... T, string_literal... Lit>
struct meta_schema<schema::Struct<schema::Member<T,Lit>...>> {
- using MetaSchema = schema::Struct<schema::Member<typename meta_schema<T>::MetaSchema,Lit>...>;
using Schema = schema::Struct<schema::Member<T,Lit>...>;
+ using MetaSchema = schema::Struct<schema::Member<typename meta_schema<T>::MetaSchema,Lit>...>;
};
template<typename... T, string_literal... Lit>
struct meta_schema<schema::Union<schema::Member<T,Lit>...>> {
- using MetaSchema = schema::Union<schema::Member<typename meta_schema<T>::MetaSchema,Lit>...>;
using Schema = schema::Union<schema::Member<T,Lit>...>;
+ using MetaSchema = schema::Union<schema::Member<typename meta_schema<T>::MetaSchema,Lit>...>;
};
template<typename... T>
struct meta_schema<schema::Tuple<T...>> {
- using MetaSchema = schema::Tuple<typename meta_schema<T>::MetaSchema...>;
using Schema = schema::Tuple<T...>;
+ using MetaSchema = schema::Tuple<typename meta_schema<T>::MetaSchema...>;
};
template<>
struct meta_schema<schema::String> {
- using MetaSchema = schema::UInt64;
using Schema = schema::String;
+ using MetaSchema = schema::UInt64;
};
/**
@@ -75,14 +75,14 @@ struct meta_schema<schema::String> {
template<typename T, uint64_t Dim>
struct meta_schema<schema::Array<T,Dim>> {
// TODO Technically this should be a FixedArray of the inner meta schema, except when the inner meta schema is Void
- using MetaSchema = schema::FixedArray<schema::UInt64,Dim>;
using Schema = schema::Array<T,Dim>;
+ using MetaSchema = schema::FixedArray<schema::UInt64,Dim>;
};
template<typename T, uint64_t... Dim>
struct meta_schema<schema::FixedArray<T,Dim...>> {
// TODO Technically this should be a FixedArray of the inner meta schema, except when the inner meta schema is Void
- using MetaSchema = schema::Void;
using Schema = schema::FixedArray<T,Dim...>;
+ using MetaSchema = schema::Void;
};
}