apache / arrow

Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
https://arrow.apache.org/
Apache License 2.0
13.89k stars 3.38k forks source link

[Format] Add metadata for single and double precision complex numbers #16264

Open asfimport opened 7 years ago

asfimport commented 7 years ago

Numerical computing libraries like NumPy and TensorFlow feature complex64 and complex128 numbers

Reporter: Wes McKinney / @wesm

PRs and other links:

Note: This issue was originally created as ARROW-638. Please see the migration documentation for further details.

asfimport commented 7 years ago

Julien Le Dem / @julienledem:

I see several possibilities:

asfimport commented 7 years ago

Wes McKinney / @wesm: As a practical matter, complex64 and complex128 probably need to be compatible with std::complex, which is implemented as a C struct with the values next to each other in memory – this is used in TensorFlow for example:

https://github.com/tensorflow/tensorflow/blob/6dfa434252b1cc3f6c523edc329853b3e8e4911c/tensorflow/core/framework/numeric_types.h#L33

in C++, this boils down to

  template<typename _Tp>
    struct complex
    {

<SNIP>

    private:
      _Tp _M_real;
      _Tp _M_imag;
    };
asfimport commented 4 years ago

Wes McKinney / @wesm: This might be simpler to handle as an ExtensionType in C++ to start

jorisvandenbossche commented 5 months ago

Mailing list discussion about this from 2021: https://www.mail-archive.com/dev@arrow.apache.org/msg23352.html

kou commented 3 weeks ago

lists.apache.org URL: https://lists.apache.org/thread/bngbnnhyq7lkyx8cg7l2qs1msd0ngg82