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

Home » Public Forums » archive » RK4 and IDL's array truncation
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
RK4 and IDL's array truncation [message #75209] Tue, 22 February 2011 07:29
Bill Nel is currently offline  Bill Nel
Messages: 31
Registered: October 2010
Member
I should know better by now, but I spent two days tracking down a
mysterious problem with RK4, IDL's Runga-Kutta integration routine.

RK4 calls a user-supplied function, passing it two variables, X and
Y.

Result = RK4( Y, Dydx, X, H, Derivs [, /DOUBLE] )

X is a scalar, but Y can be an array. The problem is that when Y is a
scalar (or a one-element array), RK4 calls your user-supplied function
with a *one-element array*, and IDL silently truncates math operations
involving arrays to the shorter array. (Normally I do argument-
checking that would have caught the problem, but I skipped it this
time, since the user-supplied function is called hundreds of thousands
of times.)

I'm posting just in case somebody else runs into mysterious problems
with RK4, but also to ask,
does anybody actually make use of array truncation? (And why you would
want to?) I've always considered it a huge mistake in the language,
and something ITTVIS should eliminate, even it would be painful for
them.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Efficient comparison of array location in two lists
Next Topic: Re: Avoiding multiple or complex WHEREs?

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

Current Time: Wed Oct 08 11:36:04 PDT 2025

Total time taken to generate the page: 0.00549 seconds