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

Home » Public Forums » archive » Re: MAKE_ARRAY question
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: MAKE_ARRAY question [message #24726 is a reply to message #24725] Fri, 13 April 2001 11:48 Go to previous messageGo to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
Paul van Delst wrote:
> One could also do:
>
> x = MAKE_ARRAY( n_pts, VALUE = 0.0, DOUBLE = double )
>
> i.e value = float if double is not set, but I want to avoid the value assignation. The
> array can be quite large (many millions of points x 2) hence the /NOZERO. The performance
> hit of using the VALUE keyword is noticeable (the /NOZERO has no effect if VALUE is used).

if keyword_set(double) then $
x = dblarr(npts, /nozero) else $
x = fltarr(npts, /nozero)

OR

x = keyword_set(double) ? dblarr(npts, /nozero) : fltarr(npts, /nozero)

Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Postscript font usage
Next Topic: Re: FOR statement

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

Current Time: Fri Oct 10 13:43:28 PDT 2025

Total time taken to generate the page: 0.72223 seconds