Module Array0
: sigend
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
type(!'a,!'b,!'c)t
The type of zero-dimensional Bigarrays whose elements have OCaml type 'a , representation kind 'b , and
memory layout 'c .
valcreate : ('a,'b)Bigarray.kind->'cBigarray.layout->('a,'b,'c)tArray0.createkindlayout returns a new Bigarray of zero dimension. kind and layout determine the array
element kind and the array layout as described for Bigarray.Genarray.create .
valinit : ('a,'b)Bigarray.kind->'cBigarray.layout->'a->('a,'b,'c)tArray0.initkindlayoutv behaves like Array0.createkindlayout except that the element is additionally
initialized to the value v .
Since 4.12
valkind : ('a,'b,'c)t->('a,'b)Bigarray.kind
Return the kind of the given Bigarray.
vallayout : ('a,'b,'c)t->'cBigarray.layout
Return the layout of the given Bigarray.
valchange_layout : ('a,'b,'c)t->'dBigarray.layout->('a,'b,'d)tArray0.change_layoutalayout returns a Bigarray with the specified layout , sharing the data with a . No
copying of elements is involved: the new array and the original array share the same storage space.
Since 4.06
valsize_in_bytes : ('a,'b,'c)t->intsize_in_bytesa is a 's Bigarray.kind_size_in_bytes .
valget : ('a,'b,'c)t->'aArray0.geta returns the only element in a .
valset : ('a,'b,'c)t->'a->unitArray0.setaxv stores the value v in a .
valblit : ('a,'b,'c)t->('a,'b,'c)t->unit
Copy the first Bigarray to the second Bigarray. See Bigarray.Genarray.blit for more details.
valfill : ('a,'b,'c)t->'a->unit
Fill the given Bigarray with the given value. See Bigarray.Genarray.fill for more details.
valof_value : ('a,'b)Bigarray.kind->'cBigarray.layout->'a->('a,'b,'c)t
Build a zero-dimensional Bigarray initialized from the given value.
OCamldoc 2025-06-12 Bigarray.Array0(3o)