|
From: Raymond T. <ray...@er...> - 2004-12-08 12:43:51
|
>>>>> "rif" == rif <ri...@MI...> writes:
rif> Is there any way, in CMUCL, using some implementation-specific
rif> construct, to create an "aliased array"? Suppose I create a
rif> double-float array of size 10:
rif> (make-array 10 :element-type 'double-float)
rif> I know I can take it's address, with #'system:vector-sap.
rif> What I want to do is manipulate that address and somehow "invert"
rif> vector-sap to create a new double-float array whose first element is
rif> (for example) the third element of the original array.
rif> I need this because I need to pass matlisp a subset of an array. More
rif> specifically, I want to allocate an n by n+1 array, so that I can
rif> store half of each of two n by n symmetric arrays in n(n+1) space
rif> rather than 2n^2 space. This is a common technique for using
rif> BLAS/LAPACK, but to get at it, I need to be able to give a Fortran
rif> matlisp routine a way to get at the square n by n matrix that "starts
rif> with the second column" of the n by n+1 matrix, and the way the
rif> interface is defined, it wants actual arrays, not pointers. If I can
rif> somehow create the appropriate array, I don't have to go mucking about
rif> in the internals of matlisp's def-fortran-routine and so forth.
Marc has already mentioned displaced arrays. This should work, but
depends on what you are really trying to do. What matlisp function
are you trying to call?
Ray
|