| Re: Bug in NR_QROMB? [message #3650 is a reply to message #3522] |
Wed, 08 February 1995 02:34  |
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
|
|
|
|