Hello,
I just spent a few minutes on figuring out how to use map-n-grids as there are no examples in the distribution or documentation.
Here is one example, here is one that accomplishes the following (in pseudo-code):
(map 'grid #'(lambda (x1 x2) (- x1 x2)) grid1 grid2)
(map-n-grids :sources `((,*array-3-4-double-float* ,(affi *array-3-4-double-float*)) (,*array-3-4-double-float* ,(affi *array-3-4-double-float*))) :combination-function #'(lambda (i x1 x2) (print i) (- x1 x2)))
In this example, I am not sure of the role of the first variable (I did not have more time to stare at map.list)
Mirko
I now have made some improvements to the documentation which include an example of map-n-grids, and I've also expanded the docstring for the function greatly so that the explanation is better.
If you want to add vectors a+2b you could do this:
(map-n-grids :sources `((,#31m(1 2 3) nil) (,#31m(9 8 7) nil)) :combination-function (lambda (a b) (+ a (* 2 b)))) #31m(19 18 17)
Liam
On Thu, Mar 4, 2010 at 4:48 PM, Mirko Vukovic mirko.vukovic@gmail.com wrote:
Hello,
I just spent a few minutes on figuring out how to use map-n-grids as there are no examples in the distribution or documentation.
Here is one example, here is one that accomplishes the following (in pseudo-code):
(map 'grid #'(lambda (x1 x2) (- x1 x2)) grid1 grid2)
(map-n-grids :sources `((,*array-3-4-double-float* ,(affi *array-3-4-double-float*)) (,*array-3-4-double-float* ,(affi *array-3-4-double-float*))) :combination-function #'(lambda (i x1 x2) (print i) (- x1 x2)))
In this example, I am not sure of the role of the first variable (I did not have more time to stare at map.list)
Mirko
Gsll-devel mailing list Gsll-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/gsll-devel