comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: simple vectorizing problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: simple vectorizing problem [message #62516 is a reply to message #62427] Thu, 11 September 2008 05:15 Go to previous message
Spon is currently offline  Spon
Messages: 178
Registered: September 2007
Senior Member
> I thought the trick with an indexing array ('a' in the example above)
> would work because if I say
> b = indgen(101)/(!pi/100)
> print, cos(b)
>
> I get not one number out but an array of cos() evaluated from 0 to pi
>
> I guess I don't understand how the cos() example gives me an array
> back, and
> myFunctThatDoesSomeAnalysis(image(*,*,a)) gives me just one number.

Simply put, the IDL function COS() has been specifically written so it
can take either scalars or arrays as arguments. If you want
myFunctThatDoesSomeAnalysis() to do the same, you have to write it in
such a way that it can also handle arrays.
Whether this can be done without expensive FOR loops depends entirely
on what your function does. If it can be done, it's probably
worthwhile doing it though.

> Thanks,
> David M.

Regards,
Chris
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Contour Issues... Help please
Next Topic: Is there a 32/64-bit save file

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:21:13 PDT 2025

Total time taken to generate the page: 0.00433 seconds