Tamas,
Very interesting. Does this map onto the GSL notion of views in any way, even conceptually? I know we discussed this before, I'm just wondering if a restricted set of affine indices could be used with GSL.
Liam
On Sun, May 18, 2008 at 12:30 PM, Tamas K Papp tpapp@princeton.edu wrote:
Hi everyone,
I finally got around to writing my affine indexing package, called affi. It is ASDF-installable, and has a tutorial.
Highlights:
- an affine index class that allows the implementation of array
slices, index permutations, reverse indexing, all provided via convenience functions
an iterator driver for iter
support for column-major affine indexes too (make-affi-cm)
map-subarray, a convenience function for mapping arrays, which is
also a proof of concept (you can do all kinds of fancy operations using iter, for example)
Examples (when the target is nil, a new array is created):
AFFI> *m* ;; the original array #2A((0 1 2 3) (4 5 6 7) (8 9 10 11)) AFFI> (map-subarray *m* nil :permutation '(1 0)) ;; transpose #2A((0 4 8) (1 5 9) (2 6 10) (3 7 11)) AFFI> (map-subarray *m* nil :source-range '(all 1)) ;; 2nd column #(1 5 9) AFFI> (map-subarray *m* nil :source-range '(all 1) :drop-which nil) #2A((1) (5) (9)) AFFI> (map-subarray *m* nil :source-range '((1 2) rev)) #2A((7 6 5 4) (11 10 9 8))
The package is enough for my present purposes, but I am happy to include new features if you can think of them. Presently it is not super-optimized, I will do that once the interface stabilizes (it is not slow of course).
Note that this package is orthogonal to the ffa package, neither depends on the other. So even if you don't like ffa, you can still benefit from fancy array slicing.
I would appreciate comments and suggestions,
Tamas
Gsll-devel mailing list Gsll-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/gsll-devel