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

Home » Public Forums » archive » Re: assoc() allocates memory... why?
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: assoc() allocates memory... why? [message #5844] Sat, 17 February 1996 00:00
Jackel is currently offline  Jackel
Messages: 30
Registered: April 1993
Member
In article <4g3cm9$p4i@peabody.colorado.edu> tarrall@plutus.Colorado.EDU (Robert Tarrall) writes:

> This is re. vanilla IDL 4.0.1, not PV-Wave, but I'm posting here as
> the comp.lang.idl newsgroup looks dead, at least at our site.

As I understand it, comp.lang.idl was already taken by the interface
description language people.

> The IDL documentation claims quite clearly that assoc() does not
> hold the data from the associated file in memory. However, it still
> seems to allocate the memory; under both IRIX and SunOS when I
> do something like:
> openr,1,"bigfile"
> x = assoc(1,fltarr(1000,301,180))
> all the memory necessary to hold a 1000x301x180 array of floats
> (i.e. 215 MB) is allocated by IDL. This seems very inefficient
> at best and perhaps even just plain dumb...

You telling IDL that the file has N elements in it, each of which are
1000x301x180 floats, so it naturally creates a buffer this large. If you have
a file with 1000 300x180 floats, then try

x= ASSOC(1,FLTARR(301,180))

which allows you to access the 200th element with

x1= x(200)
[Message index]
 
Read Message
Previous Topic: Calling a user's C program.
Next Topic: assoc() allocates memory... why?

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

Current Time: Sat Oct 11 05:47:26 PDT 2025

Total time taken to generate the page: 0.88217 seconds