Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complex support #24

Open
jjjkkkjjj opened this issue Jan 25, 2022 · 9 comments
Open

Complex support #24

jjjkkkjjj opened this issue Jan 25, 2022 · 9 comments
Labels
enhancement New feature or request

Comments

@jjjkkkjjj
Copy link
Owner

jjjkkkjjj commented Jan 25, 2022

To use vdsp, DSPSplitComplex seems to be needed according to documents

To use blas package, DSPComplex will be needed according to this discussion

to achieve to support complex type, using DSPComplex is ideal?
I must check the difference between DSPComplex and DSPSplitComplex at first.

DSPComplex is the consecutive float values.

Complex data are stored as ordered pairs of floating-point numbers. Because they are stored as ordered pairs, complex vectors require address strides that are multiples of two.

by document

On the other hand, DSPSplitComplex is stored in different memories

A structure that represents a single-precision complex vector with the real and imaginary parts stored in separate arrays.

by document

So I need to implement the function to connect this difference of memory layout

@jjjkkkjjj jjjkkkjjj added the enhancement New feature or request label Jan 25, 2022
@jjjkkkjjj
Copy link
Owner Author

Basically I store complex data as DSPComplex, and then pass DSPSplitComplex(realptr, imgptr)with 2 times strides to vDSP function

@jjjkkkjjj
Copy link
Owner Author

To convert DSPComplex into DSPSplitComplex, use vDSP_ctoz

@jjjkkkjjj
Copy link
Owner Author

Hmm, Create another object as MfArrayComplex?

@jjjkkkjjj
Copy link
Owner Author

Create MfComplexArray with realdata and imagdata simply!

jjjkkkjjj pushed a commit that referenced this issue Jul 4, 2022
@jjjkkkjjj
Copy link
Owner Author

jjjkkkjjj commented Jul 4, 2022

ToDo

  • Basic Arithmetic
  • Angle
  • Conjugate

@jjjkkkjjj
Copy link
Owner Author

MfComplexArray inherent from MfArray and MfComplexData inherit from MfData?

@jjjkkkjjj
Copy link
Owner Author

How about withUnsafeComplexPointer?

jjjkkkjjj pushed a commit that referenced this issue Jul 18, 2022
@jjjkkkjjj
Copy link
Owner Author

Complex addition was implemented by ca948f4.
But, this implementation will be hard for other modification...
So, should i integrate MfComplexArray into MfArray?

jjjkkkjjj pushed a commit that referenced this issue Jul 18, 2022
jjjkkkjjj added a commit that referenced this issue Jul 18, 2022
* store DSPComplex

* save

* refactoring complexarray

* add real and imag property

* complex addition(#24)

* integrate MfComplexArray into MfArray

* save

* Arithmetic(#24)

* angle

* conjugate

* unsupport complex

* support complex

* negative

* abs

* complex and real operation
@jjjkkkjjj jjjkkkjjj reopened this Feb 2, 2023
@jjjkkkjjj
Copy link
Owner Author

jjjkkkjjj commented Feb 2, 2023

ToDo list

  • Arithmetic Operation
  • Angle, Conjugate and Absolute
  • Math (partial: sin,cos,tan,exp,log)
  • Basic Subscription Getter
  • Basic Subscription Setter
  • Boolean Indexing Getter
  • Boolean Indexing Setter
  • Fancy Indexing Getter
  • Fancy Indexing Setter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant