Previous Contents Next
Chapter 28 The bigarray library

The bigarray library implements large, multi-dimensional, numerical arrays. These arrays are called ``big arrays'' to distinguish them from the standard Caml arrays described in section 19.2. The main differences between ``big arrays'' and standard Caml arrays are as follows: Programs that use the bigarray library must be linked as follows:
        ocamlc other options bigarray.cma other files
        ocamlopt other options bigarray.cmxa other files
For interactive use of the bigarray library, do:
        ocamlmktop -o mytop bigarray.cma
        ./mytop
or (if dynamic linking of C libraries is supported on your platform), start ocaml and type #load "bigarray.cma";;.

28.1 Module Bigarray: large, multi-dimensional, numerical arrays


This module implements multi-dimensional arrays of integers and floating-point numbers, thereafter referred to as ``big arrays''. The implementation allows efficient sharing of large numerical arrays between Caml code and C or Fortran numerical libraries.

Concerning the naming conventions, users of this module are encouraged to do open Bigarray in their source, then refer to array types and operations via short dot notation, e.g. Array1.t or Array2.sub.

Big arrays support all the Caml ad-hoc polymorphic operations: comparisons (=, <>, <=, etc, as well as compare); hashing (module