![]()
|
Module Bigarray.Array1module Array1:
One-dimensional arrays. The
Array1 structure provides operations similar to those of
Bigarray.Genarray, but specialized to the case of one-dimensional arrays.
(The Array2 and Array3 structures below provide operations
specialized for two- and three-dimensional arrays.)
Statically knowing the number of dimensions of the array allows
faster operations, and more precise static type-checking.type (
The type of one-dimensional big arrays whose elements have
Caml type
'a, representation kind 'b, and memory layout 'c.val create : Array1.create kind layout dim returns a new bigarray of
one dimension, whose size is dim. kind and layout
determine the array element kind and the array layout
as described for Genarray.create.val dim :
Return the size (dimension) of the given one-dimensional
big array.
val kind :
Return the kind of the given big array.
val layout :
Return the layout of the given big array.
val get : Array1.get a x, or alternatively a.{x},
returns the element of a at index x.
x must be greater or equal than 0 and strictly less than
Array1.dim a if a has C layout. If a has Fortran layout,
x must be greater or equal than 1 and less or equal than
Array1.dim a. Otherwise, Invalid_arg is raised.val set : Array1.set a x v, also written a.{x} <- v,
stores the value v at index x in a.
x must be inside the bounds of a as described in
Bigarray.Array1.get;
otherwise, Invalid_arg is raised.val sub :
Extract a sub-array of the given one-dimensional big array.
See
Genarray.sub_left for more details.val blit :
Copy the first big array to the second big array.
See
Genarray.blit for more details.val fill :
Fill the given big array with the given value.
See
Genarray.fill for more details.val of_array :
Build a one-dimensional big array initialized from the
given array.
val map_file :
Memory mapping of a file as a one-dimensional big array.
See
Bigarray.Genarray.map_file for more details. |