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

Home » Public Forums » archive » Re: Turning off math error checking for a code block
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: Turning off math error checking for a code block [message #28876 is a reply to message #28871] Thu, 17 January 2002 16:06 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
k-bowman@null.com (Kenneth Bowman) writes:

> In article <3C47094C.1F1879D2@ssec.wisc.edu>, "Liam E. Gumley" <Liam.Gumley@ssec.wisc.edu> wrote:
>
>> The FINITE function returns 1 where the argument is finite, and 0 where
>> the argument is infinite *or* NaN (see p. 134 of my book). Try the
>> following:
>>
>> x_min = 2.0
>> index = where(finite(x) eq 1, count)
>> if (count gt 0) then print, where(x[index] lt x_min)
>
> I am aware of that. These are relatively large vectors (10^5 to
> 10^6 elements), however, and this operation is repeated many times,
> so I am trying to avoid extracting the finite values (or creating an
> array index to them). This is my "innermost loop", and efficiency
> is important. I know there are NaN's. I prefer to simply turn off
> the error messages.

I have found that an operation on an array which contains NANs is
slowed down considerably. I think it is because each operation causes
a floating point exception which is handled in the OS. I use WHERE
most of the time when this comes up. Occassionally I get "floating
exception" messages, but big whoop.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: load sharing on multiple machines?
Next Topic: Turning off math error checking for a code block

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

Current Time: Fri Oct 10 00:44:23 PDT 2025

Total time taken to generate the page: 0.39997 seconds