256 lines
3.5 KiB
HTML
256 lines
3.5 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Bigarray.Array0</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Bigarray.Array0</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.Array0 - Zero-dimensional arrays.
|
|
<A NAME="lbAC"> </A>
|
|
<H2>Module</H2>
|
|
|
|
Module Bigarray.Array0
|
|
<A NAME="lbAD"> </A>
|
|
<H2>Documentation</H2>
|
|
|
|
<P>
|
|
Module
|
|
<B>Array0</B>
|
|
|
|
<BR> :
|
|
<B>sig end</B>
|
|
|
|
<P>
|
|
<P>
|
|
Zero-dimensional arrays. The
|
|
<B>Array0</B>
|
|
|
|
structure provides operations
|
|
similar to those of
|
|
<B>Bigarray.Genarray</B>
|
|
|
|
, 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.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.05.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>type </I>
|
|
|
|
<B>('a, 'b, 'c)</B>
|
|
|
|
<I>t </I>
|
|
|
|
<P>
|
|
<P>
|
|
The type of zero-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 -> ('a, 'b, 'c) t</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>Array0.create kind layout</B>
|
|
|
|
returns a new Bigarray of zero dimension.
|
|
<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 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>Array0.change_layout a layout</B>
|
|
|
|
returns a Bigarray with the
|
|
specified
|
|
<B>layout</B>
|
|
|
|
, sharing the data with
|
|
<B>a</B>
|
|
|
|
. No copying of elements
|
|
is involved: the new array and the original array share the same
|
|
storage space.
|
|
<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
|
|
<B>a</B>
|
|
|
|
's
|
|
<B>Bigarray.kind_size_in_bytes</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val get </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> 'a</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>Array0.get a</B>
|
|
|
|
returns the only element in
|
|
<B>a</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val set </I>
|
|
|
|
:
|
|
<B>('a, 'b, 'c) t -> 'a -> unit</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>Array0.set a x v</B>
|
|
|
|
stores the value
|
|
<B>v</B>
|
|
|
|
in
|
|
<B>a</B>
|
|
|
|
.
|
|
<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_value </I>
|
|
|
|
:
|
|
<B>('a, 'b) Bigarray.kind -></B>
|
|
|
|
<B>'c Bigarray.layout -> 'a -> ('a, 'b, 'c) t</B>
|
|
|
|
<P>
|
|
Build a zero-dimensional Bigarray initialized from the
|
|
given value.
|
|
<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>
|