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

Home » Public Forums » archive » pointer problems
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
pointer problems [message #66274] Thu, 07 May 2009 11:55 Go to previous message
tkg is currently offline  tkg
Messages: 2
Registered: May 2009
Junior Member
I'm trying to store an array of pixel xy indicies for later output to
a text file. The number of xy pairs is different for each array
element. I'm trying to use pointers to do this with the following
code snippet:

xy = ptrarr(npixels, /ALLOC)

for ipixel = 0, npixels - 1 do begin

; much snipped code

indi = where(superMask ne 0, count)

if (count gt 0) then *xy[ipixel] = array_indices(superMask,
indi)

; more snipped code

endfor

npixels can range anywhere from fewer than 100 to 200+ and the xy
pairs can be a few pair up to a few hundred.

I find that afer a few iterations of the loop (actually ten iterations
with the test data i'm using). previously allocated heap pointers are
losing their values and become undefined. This would seem to indicate
memory allocation problems (the heap pointers are being overwritten by
some other portion of the code) , but I'm not sure how to go about
troubleshooting it or what I might do to avoid the overwrites. There
are no other pointers used anywhere else in the code.

If anyone has a clue as to what the problem might be or a suggestion
for a better way to do this, I'd appreciate the help.

Thanks.
Tom
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: P value for the regression analysis?
Next Topic: Re: best image plotting routine

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

Current Time: Wed Oct 08 15:05:57 PDT 2025

Total time taken to generate the page: 0.00419 seconds