Avoiding FOR loops (version googleplex.infinity) [message #59696] |
Mon, 07 April 2008 05:42  |
Gaurav
Messages: 50 Registered: January 2007
|
Member |
|
|
Dear all,
I know IDL provides us with neat tricks to avoid the processor monster
called FOR loop but I always tend to become incapable using the magic
tricks viz WHERE when I need them the most. Will someone please show
me the way here.
What I have is a 2D Byte array. For each element I need to find the
number of elements in a surrounding 5 X 5 window that is equal to the
element under scrutiny. It is easy to achieve this using FOR loops and
EXTRAC & WHERE functions, but it obviously becomes very slow for large
arrays.
How do I avoid the FOR loop in this case using wildcards and the ":"
operator?
Like always, I hope I do not get to gnaw at my fingernails for long.
Cheers
Gaurav
|
|
|