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

Home » Public Forums » archive » Re: behavior 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: behavior of arrays [message #15431 is a reply to message #15430] Wed, 19 May 1999 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Don't get me started on this again. You can find my recent tirade on
this subject under "dropped dimensions" on dejanews.com.

For the case of your structure, I think that b.d is *actually* still a
10x1 array, but any access to it will cause IDL to automatically
collapse the degenerate dimension in the expression. Therefore, even
HELP thinks that it is a 10-vector, not a 10x1 array.

Practically speaking, you will need to REFORM() your array whenever
you need to use it.

Craig

"R.Bauer" <R.Bauer@fz-juelich.de> writes:

>
> I have some problems to understand the logic which may be behind the
> handling of an array
> like defined.
>
> Why is the result help, b.d only [10] and not [10,1] ?
>
> This means I will lose the information that's it is / was a 2-dim
> dataset.
...
> d=reform(findgen(10),10,1)
> help,d
> ;D FLOAT = Array[10, 1]
>
> b=create_struct('d',d)
> help,b,/str
>
> ;** Structure <1348428>, 1 tags, length=40, refs=1:
> ; D FLOAT Array[10, 1]
>
>
> help,b.d
> ; <Expression> FLOAT = Array[10]

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@astrog.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Variable stride in array indices and other enhancements
Next Topic: Re: IDL Book Half Price!? (Frivolous Post)

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

Current Time: Fri Oct 10 14:09:07 PDT 2025

Total time taken to generate the page: 0.64026 seconds