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

Home » Public Forums » archive » Bug in NR_QROMB?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Bug in NR_QROMB? [message #3522] Sun, 05 February 1995 12:49 Go to next message
mallozzi is currently offline  mallozzi
Messages: 60
Registered: August 1994
Member
Hi all,
I needed to compute an integral, and the integrand itself contained a
second integral, so I wrote a simple program to test this case using
the IDL-supplied NR_QROMB. In order to use NR_QROMB, you must write a
function that contains the integrand, and then you call NR_QROMB with this
function name as a parameter. In my case, within my first function, I
placed another call to QROMB to evaluate the inner integral (this is not a
double integral), the result of which becomes part of the first integrand.

If I make BOTH calls to NR_QROMB in single or double precision, I get the
wrong result. If I make one call single and the other call double, I get
the correct result. Does anyone know what is happening?
Re: Bug in NR_QROMB? [message #3650 is a reply to message #3522] Wed, 08 February 1995 02:34 Go to previous message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
In article <3h3dku$o5j@hammer.msfc.nasa.gov>, mallozzi@ssl.msfc.nasa.gov writes:
[...snip..]
|>
|> In my case, within my first function, I
|> placed another call to QROMB to evaluate the inner integral (this is not a
|> double integral), the result of which becomes part of the first integrand.
|>
|> If I make BOTH calls to NR_QROMB in single or double precision, I get the
|> wrong result. If I make one call single and the other call double, I get
|> the correct result. Does anyone know what is happening?
|>

I suspect that NR_QROMB is not re-entrant, i.e., it
uses static variables which get corrupted when NR_QROMB is called
from a function that's called by NR_QROMB. I guess all the
NR routines are hardcoded in C, so they come in two versions, one
using double precision and one using single precision. Clearly they
don't use the same static variables.

Quite silly, really. The overhead of using dynamic variables
must be extremely small compared with the overhead of calling the
IDL function, and you wouldn't experience this problem.

And yes, I'd definitely call it a bug, since the "feature" is not
documented. Shouldn't be too hard for RSI to supply a patch, though.

Stein Vidar
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL routine for compress raster-8 image? (lossless)
Next Topic: Wanted: IDL code to read DAOPHOT2 PSFs

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

Current Time: Wed Oct 08 19:13:02 PDT 2025

Total time taken to generate the page: 0.00770 seconds