[Gridflow-dev] feature requests: @fold1, @foldr, @foldr1, @scan1. @scanr, @scanr1, unary ignore

ClaudiusMaximus gloriousclaudiusmaximus at yahoo.co.uk
Tue Sep 7 12:45:07 EDT 2004


I'm missing some functions:

@fold1 binop unop [ x y z ... w ] := @fold binop (unop(x)) [ y z ... w ]
@fold  op e [ x y z ... w ]  = ((...(((e op x) op y) op z) ... ) op w)
@foldr op e [ x y z ... w ] := (x op (y op (z op ( ... (w op e)...))))

similarly for the rest.  "1" require dimension 1 or greater , "r"
associates the other way.   @scan1 and @scanr1 reduce dimension by one.

Example:

[@for ( 0 0 ) ( 4 4 ) ( 1 1 )]
  |
[@fold1 == ignore]

would result in an identity matrix, this would also require "ignore" as
an unary operator.



More information about the Gridflow-dev mailing list