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

Home » Public Forums » archive » Re: IDL, arrays, and memory
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: IDL, arrays, and memory [message #33896] Tue, 04 February 2003 09:29 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
David Fanning wrote:
>
> Sean Raffuse (sean@me.wustl.edu) writes:
>
>> I would like to create a jagged array. My array is something like:
>>
>> array = intarr(3600, 1600, 240 or less)
>>
>> Do I save space by creating a jagged array where the 3rd dimension is of
>> variable size? Is that even possible? Should I just stick with
>> 3600x1600x240?
>
> What language are you thinking of doing this in, Sean? :-)
>
> As a general rule, it is better to get all the memory you
> need at once, then trim. This avoids memory fragmentation
> problems, etc.
>
> But "jagged arrays". I'd like to see this when you are
> finished. :-)

In C, you can implement jagged arrays by defining a two-dimensional
array of pointers to allocated arrays, where each of the allocated
arrays can have a different length. You can write custom functions that
know that the length can vary, and they can be very efficient.

In IDL, while you do have pointers, there's such a big speed difference
between the native array processing facilities and user-written loops
that this is probably not worth the trouble. You're probably better off
sticking with 3600x1600x240.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Expert information needed
Next Topic: OPENW and environment variables in IDL 5.5

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

Current Time: Wed Oct 08 14:53:00 PDT 2025

Total time taken to generate the page: 0.00451 seconds