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 Module Array. 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";;.

Module Bigarray: large, multi-dimensional, numerical arrays

28.1 Big arrays in the Caml-C interface

C stub code that interface C or Fortran code with Caml code, as described in chapter 17, can exploit big arrays as follows.

28.1.1 Include file

The include file <caml/bigarray.h> must be included in the C stub file. It declares the functions, constants and macros discussed below.