[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Organization of the OCaml interface

Not all functions of type C library are interfaced; for instance, you can't manipulate saturation matrices in OCAML (buf of course, if someone asks me this feature, I can add it). The three datatypes that are interfaced are vectors, matrices, and polyhedra, and there is a corresponding module for each of these datatypes. All objects are properly finalized, thanks to the use of "custom" blocks.

The interface was developped with the CAMLIDL tool. Each `.idl' file produces a `_caml.c', a `.mli' and a `.ml' file. Each file is represents a module.

The interface is decomposed as follows:

When invalid arguments are given to some function (incompatible dimensions, out-of-bound access, ...), an Invalid_argument exception is usually thrown.

We provide a unified type for coefficients, which is the OCAML native integers. Converting to OCAML native integers coefficients as used in the C library, which can be long int, long long int or mpz_t, may produce overflow. In this case, an exception Polka.Overflow(str) is raised, carrying the string representation of the coefficient in base 10. This concerns only the functions Vector.get and Matrix.get.



This document was generated on October, 27 2006 using texi2html