Implement loading and dumping of complex64 and complex128 dtypes#63
Implement loading and dumping of complex64 and complex128 dtypes#63j6k4m8 merged 3 commits intoaplbrain:masterfrom
Conversation
|
This is great! I have to small questions for you —
|
|
PS — thank you @axelhzf SO MUCH for this contribution, I'm grateful for your help and I'm glad we can expand support for this library!!! |
Using an interleaved representation has the benefit that it is allocated as a contiguous memory block. It also integrates better with typed arrays. Having a nested array representation adds an extra level of indirection for every access, and the allocation is non-contiguous.
Removed |
great points, agreed! thank you :) |
|
Now in ≥ v1.1.0 on npm :) |
|
Awesome, thank you @j6k4m8 ! |
Implements support for loading and dumping
complex64(c8) andcomplex128(c16)complex64(c8) usesFloat32Array.complex128(c16) usesFloat64Array.Complex numbers are represented as interleaved real and imaginary parts:
[real0, imag0, real1, imag1, ...].Since complex types cannot be inferred from plain number arrays, I added a
dtypeoption to thedumpmethod