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

Home » Public Forums » archive » ARRAY OF ARRAYS
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: Array of arrays [message #47709 is a reply to message #12759] Thu, 23 February 2006 08:31 Go to previous messageGo to previous message
Fritz is currently offline  Fritz
Messages: 7
Registered: February 2006
Junior Member
One (hopefully) last question...

I have the following code:

nb_classes = 3
references = ptrarr(nb_classes)
for i=0, nb_classes-1 do begin
nb_samples = 5
list_samples = ptrarr(nb_samples)
for j=0, nb_samples-1 do begin
data = indgen(21,19,4)
list_samples[j] = ptr_New(data)
endfor
references[i] = ptr_new(list_samples)
endfor

This code is simplified because for each class, the number of samples may
vary and also the size of data.

The question is:
How do I retrieve the data, let say, for sample 3 of class 2 ?

In the previous example,
> t = PtrArr(3)
> t[0] = Ptr_New(intarr(2,5,4))
> t[1] = Ptr_New(intarr(6,5,4))
> t[2] = Ptr_New(intarr(7,8,4))

(*t[1]) allows to acces the second element
(*t[1])[*,*,2] allows to acces the third band of the second element.

But in the code above ?
I tried
> dat = (*references[0])[(*liste_samples[1])]
but dat is not the same as data.

Fran�ois, who spend much time on something that may appear very simple to
others...



"David Fanning" <davidf@dfanning.com> wrote in message
news:MPG.1e677a7dc69e8a26989ba0@news.frii.com...
> Fritz writes:
>
>> What happens if I save the array T ?
>>
>>> save, filename='Tarray.sav', T
>>
>> Does the content of T is saved ? I mean do the three arrays inside T are
>> saved ?
>> Does the restore command
>>> restore, 'Tarray.sav'
>> brings back the initial information ?
>
> I take it you are not an empiricist. :-)
>
> Yes, everything is saved and restored properly.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: iVolume isosurface placement
Next Topic: Re: flux-conserving image resampling?

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

Current Time: Fri Oct 10 08:35:41 PDT 2025

Total time taken to generate the page: 0.80173 seconds