Bigarray.Array0(3)
β¨ NAME β¨
Bigarray.Array0 β zero-dimensional arrays, straight from the OCaml library manual. Hii bestie, welcome to the tiny-but-mighty corner of Bigarray where everything is literally just one scalar value. πβ¨
π§© Module π§©
Module Bigarray.Array0
π Documentation π
Module Array0 : sig end
Array0 is all about zero-dimensional arrays. The Array0 structure gives you 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. It's giving βsmall array, big main-character energy.β π
Since 4.05 β iconic behavior since then, no cap. π«Ά
type (!'a, !'b, !'c) tβ the type of zero-dimensional Bigarrays whose elements have OCaml type'a, representation kind'b, and memory layout'c. πval create : ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> ('a, 'b, 'c) tβArray0.create kind layoutreturns a new Bigarray of zero dimension.kindandlayoutdetermine the array element kind and the array layout as described forBigarray.Genarray.create. β¨val init : ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> 'a -> ('a, 'b, 'c) tβArray0.init kind layout vbehaves likeArray0.create kind layoutexcept that the element is additionally initialized to the valuev.Since 4.12, bestie. πval kind : ('a, 'b, 'c) t -> ('a, 'b) Bigarray.kindβ return the kind of the given Bigarray. π¦val layout : ('a, 'b, 'c) t -> 'c Bigarray.layoutβ return the layout of the given Bigarray. πΈval change_layout : ('a, 'b, 'c) t -> 'd Bigarray.layout -> ('a, 'b, 'd) tβArray0.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. π₯val size_in_bytes : ('a, 'b, 'c) t -> intβsize_in_bytes aisa'sBigarray.kind_size_in_bytes. Math but make it cute. π§val get : ('a, 'b, 'c) t -> 'aβArray0.get areturns the only element ina. The one and only. πval set : ('a, 'b, 'c) t -> 'a -> unitβArray0.set a x vstores the valuevina. πΎval blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unitβ copy the first Bigarray to the second Bigarray. SeeBigarray.Genarray.blitfor more details. π«val fill : ('a, 'b, 'c) t -> 'a -> unitβ fill the given Bigarray with the given value. SeeBigarray.Genarray.fillfor more details. πval of_value : ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> 'a -> ('a, 'b, 'c) tβ build a zero-dimensional Bigarray initialized from the given value. Slay. π
That's the whole page, bestie! Source/version:OCamldoc; date:2026-06-22; manual page:Bigarray.Array0(3). Stay zero-dimensional and fabulous. π β¨π
π¦ where this page comes from
- arch rolling: ocaml 5.5.0-1 Β· LGPL2.1 AND custom: QPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms