Module Bigarray.Array0Source
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.
The type of zero-dimensional Bigarrays whose elements have OCaml type 'a, representation kind 'b, and memory layout 'c.
val create :
('a : any) ('b : any) ('c : any). ('a, 'b) kind ->
'c layout ->
('a, 'b, 'c) t @ uniqueArray0.create kind layout returns a new Bigarray of zero dimension. kind and layout determine the array element kind and the array layout as described for Genarray.create.
val init :
('a : value_or_null) ('b : any) ('c : any). ('a, 'b) kind ->
'c layout ->
'a @ local ->
('a, 'b, 'c) t @ uniqueArray0.init kind layout v behaves like Array0.create kind layout except that the element is additionally initialized to the value v.
val kind :
('a : any) ('b : any) ('c : any). ('a, 'b, 'c) t @ immutable ->
('a, 'b) kind @@ statelessReturn the kind of the given Bigarray.
val layout :
('a : any) ('b : any) ('c : any). ('a, 'b, 'c) t @ immutable ->
'c layout @@ statelessReturn the layout of the given Bigarray.
val change_layout :
('a : any) ('b : any) ('c : any). ('a, 'b, 'c) t ->
'd layout ->
('a, 'b, 'd) tArray0.change_layout a layout 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.
size_in_bytes a is a's kind_size_in_bytes.
Array0.get a returns the only element in a.
val set :
('a : value_or_null) ('b : any) ('c : any). ('a, 'b, 'c) t @ local ->
'a @ local ->
unitArray0.set a x v stores the value v in a.
val blit :
('a : any) ('b : any) ('c : any). ('a, 'b, 'c) t @ shared ->
('a, 'b, 'c) t ->
unitCopy the first Bigarray to the second Bigarray. See Genarray.blit for more details.
Fill the given Bigarray with the given value. See Genarray.fill for more details.