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

Home » Public Forums » archive » Re: Move data to structure fields without copying
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: Move data to structure fields without copying [message #79464] Sun, 04 March 2012 06:35 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Wox writes:

> Is there a way of getting an array in a structure without copying it?
>
> data=fltarr(89,1192,1192)
> struct={data:temporary(data),...}
>
> Using temporary doesn't seem to work in this instance on a 32-bit
> machine (not enough memory). I also want to avoid using pointers
>
> data=fltarr(89,1192,1192)
> struct={data:ptr_new(temporary(data)),...}
>
> This does work, but I will need to adapt all further use of the
> structure (god forbid) and it doesn't seem worth the effort because
> one day, I will have an array that can't be allocated on 32bit at all.
> Any suggestions?

Use the pointer. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Previous Topic: How to erase a (function graphics) plot.
Next Topic: clustering

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

Current Time: Thu Oct 09 13:35:12 PDT 2025

Total time taken to generate the page: 0.80202 seconds