LaurentMazare / npy-ocaml

Numpy file format support for ocaml.
Apache License 2.0
41 stars 10 forks source link

Conversion from packed arrays to bigarrays #3

Closed Octachron closed 7 years ago

Octachron commented 7 years ago

As discussed in #2 , this PR implements a set of functions

val to_bigarray[N]:  'c Bigarray.layout -> ('a,'b) Bigarray.kind -> packed_array[N] ->
   ('a,'b,'c) Bigarray.Array[N].t option

which unpacks a packed array if it underlyng type matches the kind and layout arguments and returns None otherwise. I am not sure if these names are ideal, so please feel free to rename those liberally.

LaurentMazare commented 7 years ago

Thanks for the PR!