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 t('a, 'b, 'c);
The type of three-dimensional big arrays whose elements have
OCaml type 'a
, representation kind 'b
, and memory layout 'c
.
let create:
(Bigarray.kind('a, 'b), Bigarray.layout('c), int, int, int) => t('a, 'b, 'c);
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
.
let dim1: t('a, 'b, 'c) => int;
Return the first dimension of the given three-dimensional big array.
let dim2: t('a, 'b, 'c) => int;
Return the second dimension of the given three-dimensional big array.
let dim3: t('a, 'b, 'c) => int;
Return the third dimension of the given three-dimensional big array.
let kind: t('a, 'b, 'c) => Bigarray.kind('a, 'b);
Return the kind of the given big array.
let layout: t('a, 'b, 'c) => Bigarray.layout('c);
Return the layout of the given big array.
let get: (t('a, 'b, 'c), 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.
let set: (t('a, 'b, 'c), 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.
let sub_left:
(t('a, 'b, Bigarray.c_layout), int, int) => t('a, 'b, Bigarray.c_layout);
Extract a three-dimensional sub-array of the given
three-dimensional big array by restricting the first dimension.
See
Bigarray.Genarray.sub_left
for more details.
Array3.sub_left
applies only to arrays with C layout.
let sub_right:
(t('a, 'b, Bigarray.fortran_layout), int, int) =>
t('a, 'b, Bigarray.fortran_layout);
Extract a three-dimensional sub-array of the given
three-dimensional big array by restricting the second dimension.
See
Bigarray.Genarray.sub_right
for more details.
Array3.sub_right
applies only to arrays with Fortran layout.
let slice_left_1:
(t('a, 'b, Bigarray.c_layout), int, int) =>
Bigarray.Array1.t('a, 'b, Bigarray.c_layout);
Extract a one-dimensional slice of the given three-dimensional
big array by fixing the first two coordinates.
The integer parameters are the coordinates of the slice to
extract. See
Bigarray.Genarray.slice_left
for more details.
Array3.slice_left_1
applies only to arrays with C layout.
let slice_right_1:
(t('a, 'b, Bigarray.fortran_layout), int, int) =>
Bigarray.Array1.t('a, 'b, Bigarray.fortran_layout);
Extract a one-dimensional slice of the given three-dimensional
big array by fixing the last two coordinates.
The integer parameters are the coordinates of the slice to
extract. See
Bigarray.Genarray.slice_right
for more details.
Array3.slice_right_1
applies only to arrays with Fortran
layout.
let slice_left_2:
(t('a, 'b, Bigarray.c_layout), int) =>
Bigarray.Array2.t('a, 'b, Bigarray.c_layout);
Extract a two-dimensional slice of the given three-dimensional
big array by fixing the first coordinate.
The integer parameter is the first coordinate of the slice to
extract. See
Bigarray.Genarray.slice_left
for more details.
Array3.slice_left_2
applies only to arrays with C layout.
let slice_right_2:
(t('a, 'b, Bigarray.fortran_layout), int) =>
Bigarray.Array2.t('a, 'b, Bigarray.fortran_layout);
Extract a two-dimensional slice of the given
three-dimensional big array by fixing the last coordinate.
The integer parameter is the coordinate of the slice
to extract. See
Bigarray.Genarray.slice_right
for more details.
Array3.slice_right_2
applies only to arrays with Fortran
layout.
let blit: (t('a, 'b, 'c), t('a, 'b, 'c)) => unit;
let fill: (t('a, 'b, 'c), 'a) => unit;
let of_array:
(Bigarray.kind('a, 'b), Bigarray.layout('c), array(array(array('a)))) =>
t('a, 'b, 'c);
Build a three-dimensional big array initialized from the
given array of arrays of arrays.
let map_file:
(
Unix.file_descr,
~pos: int64=?,
Bigarray.kind('a, 'b),
Bigarray.layout('c),
bool,
int,
int,
int
) =>
t('a, 'b, 'c);
let unsafe_get: (t('a, 'b, 'c), int, int, int) => 'a;
let unsafe_set: (t('a, 'b, 'c), int, int, int, 'a) => unit;