ocaml - Bigarray.Array1.t type constructor -
i saw such type declartion @ here
type int64_array = (int64, bigarray.int32_elt, bigarray.c_layout) bigarray.array1.t from manual, learnt ('a, 'b, 'c) bigarray.array1.t, 'a type of array element, , 'b representation kind.
why can use int32_elt represent int64?
if type usable, represent values int64 when accessed ocaml, store them internally int32 values. similar case store 8-bit values in array , represent them ints when accessed ocaml.
however, far can see can't create arrays of type. can create arrays of kinds defined in bigarray:
val float32 : (float, float32_elt) kind val float64 : (float, float64_elt) kind val complex32 : (complex.t, complex32_elt) kind val complex64 : (complex.t, complex64_elt) kind val int8_signed : (int, int8_signed_elt) kind val int8_unsigned : (int, int8_unsigned_elt) kind val int16_signed : (int, int16_signed_elt) kind val int16_unsigned : (int, int16_unsigned_elt) kind val int : (int, int_elt) kind val int32 : (int32, int32_elt) kind val int64 : (int64, int64_elt) kind val nativeint : (nativeint, nativeint_elt) kind val char : (char, int8_unsigned_elt) kind i don't know what's going on the code link to. perhaps doing clever.
Comments
Post a Comment