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

Home » Public Forums » archive » matrix division
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: matrix division [message #60567 is a reply to message #60444] Thu, 22 May 2008 08:48 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
jameskuyper@verizon.net writes:

> For the integer case:
>
> ratio = numerator/denominator
> bad = WHERE(denominator eq 0, count)
> IF count gt 0 THEN ratio[bad] = replacement_value
>
> replacement_value needs to be carefully chose for the context of your
> problem. You might want to give different replacement values depending
> upon whether the numerator is positive, negative, or 0. There's
> probably a more elegant approach, but three different WHERE's would
> certainly be sufficient to cover those cases.
>
> For the floating point case, IDL fills in the relevant elements of
> ratio with -Inf, Nan, or Inf, depending upon the sign of the
> numerator, and I can't think of any better way of handling it than to
> use precisely those value. If you need to use your result for further
> computations where those values would be unacceptable, replace them,
> with logic similar to the above, but using the FINITE() function.

Shoot. I was hoping for an elegant solution. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[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
Read Message
Read Message
Previous Topic: Re: Solarsoft and idlwave?
Next Topic: On the Coyote Path

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

Current Time: Sun Oct 12 07:33:55 PDT 2025

Total time taken to generate the page: 0.79001 seconds