[Jprogramming] how to work with images - or 2D arrays?

Brian Schott schott.brian at gmail.com
Thu May 31 01:26:49 HKT 2012


Continuing with 1D and allowing for negative shift I have the following
Still no 2D version, though.

   s=: adverb define
:
if. m >: 0
do.
   s=. y,~   m {.x
   f=. x, (1-m){.y
else.
   s=. y, (m-1){.x
   f=. x,~ (-m){.y
end.
f,:s
)

mean=: +/ % #

   mean (i. 5) _1 s 2* i. 4
0 1 2.5 4 3 4


-- 
(B=)


More information about the Programming mailing list