module Array3: sig .. end
Three-dimensional arrays. The
Array3
structure provides operations
similar to those of
Bigarray.Genarray
, but specialized to the case
of three-dimensional arrays.
type ('a, 'b, 'c) t
The type of three-dimensional big arrays whose elements have
OCaml type 'a
, representation kind 'b
, and memory layout 'c
.
val create : ('a, 'b) Bigarray.kind ->
'c Bigarray.layout -> int -> int -> int -> ('a, 'b, 'c) t
Array3.create kind layout dim1 dim2 dim3
returns a new bigarray of
three dimension, whose size is
dim1
in the first dimension,
dim2
in the second dimension, and
dim3
in the third.
kind
and
layout
determine the array element kind and
the array layout as described for
Bigarray.Genarray.create
.
val dim1 : ('a, 'b, 'c) t -> int
Return the first dimension of the given three-dimensional big array.
val dim2 : ('a, 'b, 'c) t -> int
Return the second dimension of the given three-dimensional big array.
val dim3 : ('a, 'b, 'c) t -> int
Return the third dimension of the given three-dimensional big array.
val kind : ('a, 'b, 'c) t -> ('a, 'b) Bigarray.kind
Return the kind of the given big array.
val layout : ('a, 'b, 'c) t -> 'c Bigarray.layout
Return the layout of the given big array.
val get : ('a, 'b, 'c) t -> int -> int -> int -> 'a
Array3.get a x y z
, also written
a.{x,y,z}
,
returns the element of
a
at coordinates (
x
,
y
,
z
).
x
,
y
and
z
must be within the bounds of
a
,
as described for
Bigarray.Genarray.get
;
otherwise,
Invalid_argument
is raised.
val set : ('a, 'b, 'c) t -> int -> int -> int -> 'a -> unit
Array3.set a x y v
, or alternatively
a.{x,y,z} <- v
,
stores the value
v
at coordinates (
x
,
y
,
z
) in
a
.
x
,
y
and
z
must be within the bounds of
a
,
as described for
Bigarray.Genarray.set
;
otherwise,
Invalid_argument
is raised.
val blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit
val fill : ('a, 'b, 'c) t -> 'a -> unit
val of_array : ('a, 'b) Bigarray.kind ->
'c Bigarray.layout -> 'a array array array -> ('a, 'b, 'c) t
Build a three-dimensional big array initialized from the
given array of arrays of arrays.
val unsafe_get : ('a, 'b, 'c) t -> int -> int -> int -> 'a
val unsafe_set : ('a, 'b, 'c) t -> int -> int -> int -> 'a -> unit