You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wes McKinney (JIRA)" <ji...@apache.org> on 2017/03/16 18:42:42 UTC

[jira] [Comment Edited] (ARROW-638) [Format] Add metadata for single and double precision complex numbers

    [ https://issues.apache.org/jira/browse/ARROW-638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15928617#comment-15928617 ] 

Wes McKinney edited comment on ARROW-638 at 3/16/17 6:42 PM:
-------------------------------------------------------------

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

{code:language=c++}
  template<typename _Tp>
    struct complex
    {

<SNIP>

    private:
      _Tp _M_real;
      _Tp _M_imag;
    };
{code}


was (Author: wesmckinn):
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

{code:language=c++}
  template<typename _Tp>
    struct complex
    {

<SNIP>

    private:
      _Tp _M_real;
      _Tp _M_imag;
    };
{code}

> [Format] Add metadata for single and double precision complex numbers
> ---------------------------------------------------------------------
>
>                 Key: ARROW-638
>                 URL: https://issues.apache.org/jira/browse/ARROW-638
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: Format
>            Reporter: Wes McKinney
>
> Numerical computing libraries like NumPy and TensorFlow feature complex64 and complex128 numbers



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)