[clean-list] suggestion for htoclean and arrays

Shivkumar Chandrasekaran shiv@ece.ucsb.edu
Thu, 27 Dec 2001 11:29:29 -0800


Now that htoclean can handle arrays I am trying to interface Lapack and 
Blas to Clean. However most Lapack routines will accept pointers into 
the middle of the array (not necessarily the beginning only). Currently 
htoclean will only generate and pass pointers to the beginning of Clean 
arrays. One way to work around this is to write wrappers in C that will 
accept a pointer to the beginning of the array, and, a displacement, and 
then generate the actual call to Lapack with the right pointer. However 
this seems to be a job that htoclean could do well.

So my suggestion is to extend htoclean such that when calling a C 
routine that accepts a pointer to an array, it generates a Clean 
function that takes two arguments in its place: a pointer to the 
beginning of the array and a displacement which will be added to the 
pointer before calling the external C routine.

In Ocaml this is handled differently. In the Bigarray module there are 
explicit functions to construct sub-arrays. However, it seems to me that 
this could be incompatible with Clean's uniqueness types.

--shiv--