Module Bigarray.Array0
Zero-dimensional arrays. The Array0 structure provides operations similar to those of Bigarray.Genarray, but specialized to the case of zero-dimensional arrays that only contain a single scalar value. Statically knowing the number of dimensions of the array allows faster operations, and more precise static type-checking.
- since
- 4.05.0
type ('a, 'b, 'c) tThe type of zero-dimensional Bigarrays whose elements have OCaml type
'a, representation kind'b, and memory layout'c.
val create : ('a, 'b) kind -> 'c layout -> ('a, 'b, 'c) tArray0.create kind layoutreturns a new Bigarray of zero dimension.kindandlayoutdetermine the array element kind and the array layout as described forGenarray.create.
val change_layout : ('a, 'b, 'c) t -> 'd layout -> ('a, 'b, 'd) tArray0.change_layout a layoutreturns a Bigarray with the specifiedlayout, sharing the data witha. No copying of elements is involved: the new array and the original array share the same storage space.- since
- 4.06.0
val size_in_bytes : ('a, 'b, 'c) t -> intsize_in_bytes aisa'skind_size_in_bytes.
val get : ('a, 'b, 'c) t -> 'aArray0.get areturns the only element ina.
val set : ('a, 'b, 'c) t -> 'a -> unitArray0.set a x vstores the valuevina.
val blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unitCopy the first Bigarray to the second Bigarray. See
Genarray.blitfor more details.
val fill : ('a, 'b, 'c) t -> 'a -> unitFill the given Bigarray with the given value. See
Genarray.fillfor more details.