From 0ff0e346ccc02bbd1a7d1a8a4fbd3e6de5ae5664 Mon Sep 17 00:00:00 2001 From: Simon Perkins Date: Fri, 4 Jun 2021 15:20:03 +0200 Subject: [PATCH 1/5] [skip ci] Initial Commit --- cpp/src/arrow/ipc/feather.fbs | 5 +- cpp/src/arrow/type.cc | 10 + cpp/src/arrow/type.h | 32 ++ cpp/src/arrow/type_fwd.h | 6 + cpp/src/generated/File_generated.h | 9 +- cpp/src/generated/Message_generated.h | 15 +- cpp/src/generated/Schema_generated.h | 45 +-- cpp/src/generated/SparseTensor_generated.h | 68 ++-- cpp/src/generated/Tensor_generated.h | 2 - cpp/src/generated/feather_generated.h | 23 +- cpp/src/plasma/common_generated.h | 27 +- cpp/src/plasma/plasma_generated.h | 343 +++++++-------------- 12 files changed, 241 insertions(+), 344 deletions(-) diff --git a/cpp/src/arrow/ipc/feather.fbs b/cpp/src/arrow/ipc/feather.fbs index b4076be8757..5dc5b0255ed 100644 --- a/cpp/src/arrow/ipc/feather.fbs +++ b/cpp/src/arrow/ipc/feather.fbs @@ -54,7 +54,10 @@ enum Type : byte { TIME = 16, LARGE_UTF8 = 17, - LARGE_BINARY = 18 + LARGE_BINARY = 18, + + COMPLEX_FLOAT = 19, + COMPLEX_DOUBLE = 20 } enum Encoding : byte { diff --git a/cpp/src/arrow/type.cc b/cpp/src/arrow/type.cc index 344585446fc..4308a4f701f 100644 --- a/cpp/src/arrow/type.cc +++ b/cpp/src/arrow/type.cc @@ -399,6 +399,16 @@ FloatingPointType::Precision DoubleType::precision() const { return FloatingPointType::DOUBLE; } +ComplexType::Precision ComplexFloatType::precision() const { + return ComplexType::SINGLE; +} + +ComplexType::Precision ComplexDoubleType::precision() const { + return ComplexType::DOUBLE; +} + + + std::string ListType::ToString() const { std::stringstream s; s << "list<" << value_field()->ToString() << ">"; diff --git a/cpp/src/arrow/type.h b/cpp/src/arrow/type.h index 1d3d1e27f92..7dfeb9a49a2 100644 --- a/cpp/src/arrow/type.h +++ b/cpp/src/arrow/type.h @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -229,6 +230,13 @@ class ARROW_EXPORT FloatingPointType : public NumberType { virtual Precision precision() const = 0; }; +class ARROW_EXPORT ComplexType : public NumberType { + public: + using NumberType::NumberType; + enum Precision { HALF, SINGLE, DOUBLE }; + virtual Precision precision() const = 0; +}; + /// \brief Base class for all parametric data types class ParametricType {}; @@ -549,6 +557,30 @@ class ARROW_EXPORT DoubleType std::string ComputeFingerprint() const override; }; + +/// Concrete type class for 32-bit complex floating-point data (C "float complex") +class ARROW_EXPORT ComplexFloatType + : public detail::CTypeImpl> { + public: + Precision precision() const override; + static constexpr const char* type_name() { return "complexfloat"; } + + protected: + std::string ComputeFingerprint() const override; +}; + +/// Concrete type class for 64-bit complex floating-point data (C "double complex") +class ARROW_EXPORT ComplexDoubleType + : public detail::CTypeImpl> { + public: + Precision precision() const override; + static constexpr const char* type_name() { return "complexdouble"; } + + protected: + std::string ComputeFingerprint() const override; +}; + + /// \brief Base class for all variable-size list data types class ARROW_EXPORT BaseListType : public NestedType { public: diff --git a/cpp/src/arrow/type_fwd.h b/cpp/src/arrow/type_fwd.h index 7e564106bbe..15bcc774a7f 100644 --- a/cpp/src/arrow/type_fwd.h +++ b/cpp/src/arrow/type_fwd.h @@ -394,6 +394,12 @@ struct Type { /// Like LIST, but with 64-bit offsets LARGE_LIST, + // 32-bit COMPLEX values + COMPLEX_FLOAT, + + // 64-bit COMPLEX values + COMPLEX_DOUBLE, + // Leave this at the end MAX_ID }; diff --git a/cpp/src/generated/File_generated.h b/cpp/src/generated/File_generated.h index 06953c4a040..71a174dfcca 100644 --- a/cpp/src/generated/File_generated.h +++ b/cpp/src/generated/File_generated.h @@ -26,8 +26,12 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Block FLATBUFFERS_FINAL_CLASS { int64_t bodyLength_; public: - Block() { - memset(static_cast(this), 0, sizeof(Block)); + Block() + : offset_(0), + metaDataLength_(0), + padding0__(0), + bodyLength_(0) { + (void)padding0__; } Block(int64_t _offset, int32_t _metaDataLength, int64_t _bodyLength) : offset_(flatbuffers::EndianScalar(_offset)), @@ -119,7 +123,6 @@ struct FooterBuilder { : fbb_(_fbb) { start_ = fbb_.StartTable(); } - FooterBuilder &operator=(const FooterBuilder &); flatbuffers::Offset