528 lines
7.7 KiB
HTML
528 lines
7.7 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Bigarray.Array3</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Bigarray.Array3</H1>
|
|
Section: OCaml library (3o)<BR>Updated: 2020-01-30<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Bigarray.Array3 - Three-dimensional arrays.
|
|
<A NAME="lbAC"> </A>
|
|
<H2>Module</H2>
|
|
|
|
Module Bigarray.Array3
|
|
<A NAME="lbAD"> </A>
|
|
<H2>Documentation</H2>
|
|
|
|
<P>
|
|
Module
|
|
<B>Array3</B>
|
|
|
|
<BR> :
|
|
<B>sig end</B>
|
|
|
|
<P>
|
|
<P>
|
|
Three-dimensional arrays. The
|
|
<B>Array3</B>
|
|
|
|
structure provides operations
|
|
similar to those of
|
|
<B>Bigarray.Genarray</B>
|
|
|
|
, but specialized to the case
|
|
of three-dimensional arrays.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>type </I>
|
|
|
|
<B>('a, 'b, 'c)</B>
|
|
|
|
<I>t </I>
|
|
|
|
<P>
|
|
<P>
|
|
The type of three-dimensional Bigarrays whose elements have
|
|
OCaml type
|
|
<B>'a</B>
|
|
|
|
, representation kind
|
|
<B>'b</B>
|
|
|
|
, and memory layout
|
|
<B>'c</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val create </I>
|
|
|
|
:
|
|
<B>('a, 'b) Bigarray.kind -></B>
|
|
|
|
<B>'c Bigarray.layout -> int -> int -> int -> ('a, 'b, 'c) t</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>Array3.create kind layout dim1 dim2 dim3</B>
|
|
|
|
returns a new Bigarray of
|
|
three dimension, whose size is
|
|
<B>dim1</B>
|
|
|
|
in the first dimension,
|
|
<B>dim2</B>
|
|
|
|
in the second dimension, and
|
|
<B>dim3</B>
|
|
|
|
in the third.
|
|
<B>kind</B>
|
|
|
|
and
|
|
<B>layout</B>
|
|
|
|
determine the array element kind and
|
|
the array layout as described for
|
|
<B>Bigarray.Genarray.create</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val dim1 </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> int</B>
|
|
|
|
<P>
|
|
Return the first dimension of the given three-dimensional Bigarray.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val dim2 </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> int</B>
|
|
|
|
<P>
|
|
Return the second dimension of the given three-dimensional Bigarray.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val dim3 </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> int</B>
|
|
|
|
<P>
|
|
Return the third dimension of the given three-dimensional Bigarray.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val kind </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> ('a, 'b) Bigarray.kind</B>
|
|
|
|
<P>
|
|
Return the kind of the given Bigarray.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val layout </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> 'c Bigarray.layout</B>
|
|
|
|
<P>
|
|
Return the layout of the given Bigarray.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val change_layout </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -></B>
|
|
|
|
<B>'d Bigarray.layout -> ('a, 'b, 'd) t</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>Array3.change_layout a layout</B>
|
|
|
|
returns a Bigarray with the
|
|
specified
|
|
<B>layout</B>
|
|
|
|
, sharing the data with
|
|
<B>a</B>
|
|
|
|
(and hence having
|
|
the same dimensions as
|
|
<B>a</B>
|
|
|
|
). No copying of elements is involved: the
|
|
new array and the original array share the same storage space.
|
|
The dimensions are reversed, such that
|
|
<B>get v [| a; b; c |]</B>
|
|
|
|
in
|
|
C layout becomes
|
|
<B>get v [| c+1; b+1; a+1 |]</B>
|
|
|
|
in Fortran layout.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.06.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val size_in_bytes </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> int</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>size_in_bytes a</B>
|
|
|
|
is the number of elements in
|
|
<B>a</B>
|
|
|
|
multiplied by
|
|
<B>a</B>
|
|
|
|
's
|
|
<B>Bigarray.kind_size_in_bytes</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.03.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val get </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> int -> int -> int -> 'a</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>Array3.get a x y z</B>
|
|
|
|
, also written
|
|
<B>a.{x,y,z}</B>
|
|
|
|
,
|
|
returns the element of
|
|
<B>a</B>
|
|
|
|
at coordinates (
|
|
<B>x</B>
|
|
|
|
,
|
|
<B>y</B>
|
|
|
|
,
|
|
<B>z</B>
|
|
|
|
).
|
|
<B>x</B>
|
|
|
|
,
|
|
<B>y</B>
|
|
|
|
and
|
|
<B>z</B>
|
|
|
|
must be within the bounds of
|
|
<B>a</B>
|
|
|
|
,
|
|
as described for
|
|
<B>Bigarray.Genarray.get</B>
|
|
|
|
;
|
|
otherwise,
|
|
<B>Invalid_argument</B>
|
|
|
|
is raised.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val set </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> int -> int -> int -> 'a -> unit</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>Array3.set a x y v</B>
|
|
|
|
, or alternatively
|
|
<B>a.{x,y,z} <- v</B>
|
|
|
|
,
|
|
stores the value
|
|
<B>v</B>
|
|
|
|
at coordinates (
|
|
<B>x</B>
|
|
|
|
,
|
|
<B>y</B>
|
|
|
|
,
|
|
<B>z</B>
|
|
|
|
) in
|
|
<B>a</B>
|
|
|
|
.
|
|
<B>x</B>
|
|
|
|
,
|
|
<B>y</B>
|
|
|
|
and
|
|
<B>z</B>
|
|
|
|
must be within the bounds of
|
|
<B>a</B>
|
|
|
|
,
|
|
as described for
|
|
<B>Bigarray.Genarray.set</B>
|
|
|
|
;
|
|
otherwise,
|
|
<B>Invalid_argument</B>
|
|
|
|
is raised.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val sub_left </I>
|
|
|
|
:
|
|
<B>('a, 'b, Bigarray.c_layout) t -></B>
|
|
|
|
<B>int -> int -> ('a, 'b, Bigarray.c_layout) t</B>
|
|
|
|
<P>
|
|
Extract a three-dimensional sub-array of the given
|
|
three-dimensional Bigarray by restricting the first dimension.
|
|
See
|
|
<B>Bigarray.Genarray.sub_left</B>
|
|
|
|
for more details.
|
|
<B>Array3.sub_left</B>
|
|
|
|
applies only to arrays with C layout.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val sub_right </I>
|
|
|
|
:
|
|
<B>('a, 'b, Bigarray.fortran_layout) t -></B>
|
|
|
|
<B>int -> int -> ('a, 'b, Bigarray.fortran_layout) t</B>
|
|
|
|
<P>
|
|
Extract a three-dimensional sub-array of the given
|
|
three-dimensional Bigarray by restricting the second dimension.
|
|
See
|
|
<B>Bigarray.Genarray.sub_right</B>
|
|
|
|
for more details.
|
|
<B>Array3.sub_right</B>
|
|
|
|
applies only to arrays with Fortran layout.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val slice_left_1 </I>
|
|
|
|
:
|
|
<B>('a, 'b, Bigarray.c_layout) t -></B>
|
|
|
|
<B>int -> int -> ('a, 'b, Bigarray.c_layout) Bigarray.Array1.t</B>
|
|
|
|
<P>
|
|
Extract a one-dimensional slice of the given three-dimensional
|
|
Bigarray by fixing the first two coordinates.
|
|
The integer parameters are the coordinates of the slice to
|
|
extract. See
|
|
<B>Bigarray.Genarray.slice_left</B>
|
|
|
|
for more details.
|
|
<B>Array3.slice_left_1</B>
|
|
|
|
applies only to arrays with C layout.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val slice_right_1 </I>
|
|
|
|
:
|
|
<B>('a, 'b, Bigarray.fortran_layout) t -></B>
|
|
|
|
<B>int -> int -> ('a, 'b, Bigarray.fortran_layout) Bigarray.Array1.t</B>
|
|
|
|
<P>
|
|
Extract a one-dimensional slice of the given three-dimensional
|
|
Bigarray by fixing the last two coordinates.
|
|
The integer parameters are the coordinates of the slice to
|
|
extract. See
|
|
<B>Bigarray.Genarray.slice_right</B>
|
|
|
|
for more details.
|
|
<B>Array3.slice_right_1</B>
|
|
|
|
applies only to arrays with Fortran
|
|
layout.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val slice_left_2 </I>
|
|
|
|
:
|
|
<B>('a, 'b, Bigarray.c_layout) t -></B>
|
|
|
|
<B>int -> ('a, 'b, Bigarray.c_layout) Bigarray.Array2.t</B>
|
|
|
|
<P>
|
|
Extract a two-dimensional slice of the given three-dimensional
|
|
Bigarray by fixing the first coordinate.
|
|
The integer parameter is the first coordinate of the slice to
|
|
extract. See
|
|
<B>Bigarray.Genarray.slice_left</B>
|
|
|
|
for more details.
|
|
<B>Array3.slice_left_2</B>
|
|
|
|
applies only to arrays with C layout.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val slice_right_2 </I>
|
|
|
|
:
|
|
<B>('a, 'b, Bigarray.fortran_layout) t -></B>
|
|
|
|
<B>int -> ('a, 'b, Bigarray.fortran_layout) Bigarray.Array2.t</B>
|
|
|
|
<P>
|
|
Extract a two-dimensional slice of the given
|
|
three-dimensional Bigarray by fixing the last coordinate.
|
|
The integer parameter is the coordinate of the slice
|
|
to extract. See
|
|
<B>Bigarray.Genarray.slice_right</B>
|
|
|
|
for more details.
|
|
<B>Array3.slice_right_2</B>
|
|
|
|
applies only to arrays with Fortran
|
|
layout.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val blit </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit</B>
|
|
|
|
<P>
|
|
Copy the first Bigarray to the second Bigarray.
|
|
See
|
|
<B>Bigarray.Genarray.blit</B>
|
|
|
|
for more details.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val fill </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> 'a -> unit</B>
|
|
|
|
<P>
|
|
Fill the given Bigarray with the given value.
|
|
See
|
|
<B>Bigarray.Genarray.fill</B>
|
|
|
|
for more details.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val of_array </I>
|
|
|
|
:
|
|
<B>('a, 'b) Bigarray.kind -></B>
|
|
|
|
<B>'c Bigarray.layout -> 'a array array array -> ('a, 'b, 'c) t</B>
|
|
|
|
<P>
|
|
Build a three-dimensional Bigarray initialized from the
|
|
given array of arrays of arrays.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val unsafe_get </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> int -> int -> int -> 'a</B>
|
|
|
|
<P>
|
|
Like
|
|
<B>Bigarray.Array3.get</B>
|
|
|
|
, but bounds checking is not always
|
|
performed.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val unsafe_set </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> int -> int -> int -> 'a -> unit</B>
|
|
|
|
<P>
|
|
Like
|
|
<B>Bigarray.Array3.set</B>
|
|
|
|
, but bounds checking is not always
|
|
performed.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">Module</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">Documentation</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:36 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|