Guile Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile numerical work and uniform arrays



> Thus, I would like to have possibility to distinguish between these
> two situations, and, _if_it_is_possible_, to use the underlying
> one-dimensional chunk of multi-dim. array directly, without copying
> its data to new location (and back).

I agree you don't want to copy the underlying data if you don't have to.
But I think we need to distinguish:
(1) the underlying one-dimensional array that a shared array descriptor
points to, and
(2) the address in memory of the first element of the array.

The former is a SCM value.  I still see no use for a Scheme
program to be able to access it.  The latter is an (int*) or
a (double*) or even a (SCM*).  It is useful in passing the data
to C or Fortran routines.

Because the address of the first element is not a SCM value,
there should be no Scheme function to get it.  It should
only be a function in the C API.  (Of course the FFI glue
code should automatically get the address when specified.)

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner

Guile Home | Main Index | Thread Index