From 6d4dbbd5cafce3435ca4c7aae020ba17e5a89b87 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 15 Apr 2026 19:11:42 +0200 Subject: Dangling changes and added cross product --- modules/codec/c++/data.hpp | 2 -- modules/codec/c++/math.hpp | 15 +++++++++++++++ modules/codec/c++/schema_meta.hpp | 18 +++++++++--------- 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, encode::Native> { uint64_t s = 1; for(uint64_t iter = 0; iter < Dim; ++iter){ - auto& dim_iter = dims_.at(data{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 @@ -140,6 +140,21 @@ data,Encoding> cross( return cross_prod; } +template +data,Encoding> cross( + const data, Encoding> lh, + const data, Encoding> rh +){ + data, 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 data,Encoding> cos( const data,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 { template struct meta_schema> { - using MetaSchema = schema::Void; using Schema = schema::Primitive; + using MetaSchema = schema::Void; }; template @@ -35,38 +35,38 @@ struct meta_schema, schema::Prim template struct meta_schema> { - using MetaSchema = schema::Void; using Schema = schema::Ref; + using MetaSchema = schema::Void; }; template struct meta_schema> { - using MetaSchema = schema::Void; using Schema = schema::Map; + using MetaSchema = schema::Void; }; template struct meta_schema...>> { - using MetaSchema = schema::Struct::MetaSchema,Lit>...>; using Schema = schema::Struct...>; + using MetaSchema = schema::Struct::MetaSchema,Lit>...>; }; template struct meta_schema...>> { - using MetaSchema = schema::Union::MetaSchema,Lit>...>; using Schema = schema::Union...>; + using MetaSchema = schema::Union::MetaSchema,Lit>...>; }; template struct meta_schema> { - using MetaSchema = schema::Tuple::MetaSchema...>; using Schema = schema::Tuple; + using MetaSchema = schema::Tuple::MetaSchema...>; }; template<> struct meta_schema { - using MetaSchema = schema::UInt64; using Schema = schema::String; + using MetaSchema = schema::UInt64; }; /** @@ -75,14 +75,14 @@ struct meta_schema { template struct meta_schema> { // TODO Technically this should be a FixedArray of the inner meta schema, except when the inner meta schema is Void - using MetaSchema = schema::FixedArray; using Schema = schema::Array; + using MetaSchema = schema::FixedArray; }; template struct meta_schema> { // 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; + using MetaSchema = schema::Void; }; } -- cgit v1.2.3