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

Home » Public Forums » archive » HDF SDS array access in IDL
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: HDF SDS array access in IDL [message #13265 is a reply to message #13178] Wed, 28 October 1998 00:00 Go to previous messageGo to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
"Dr. G. Scott Lett" <slett@holisticmath.com> writes:

> IDL uses a storage scheme like C, not Fortran. The question of
> column-majority and row-majority was a source of confusion at RSI for some
> time, and this confusion was evident in some of their documentation. Recent
> editions should be better.


I completely disagree!!!! IDL uses a storage system like Fortran. The
leftmost index is the one that changes most rapidly in the stored array. For
example, if we execute the IDL commands

IDL> a = findgen(3,5)
IDL> print,a
0.00000 1.00000 2.00000
3.00000 4.00000 5.00000
6.00000 7.00000 8.00000
9.00000 10.0000 11.0000
12.0000 13.0000 14.0000
IDL> print,a[*]
0.00000 1.00000 2.00000 3.00000 4.00000 5.00000
6.00000 7.00000 8.00000 9.00000 10.0000 11.0000
12.0000 13.0000 14.0000

One can see immediately that the first index is the one that changes most
rapidly. FORTRAN behaves exactly the same way.

In C this is reversed. I quote from "The C Programming Language, Second
Edition" by Brian W. Kernighan and Dennis M. Ritchie.

... In C, a two dimensional array is really a one-dimensional array,
each of whose elements is an array. Hence subscripts are written as

daytab[i][j] /* [row][col] */

rather than

daytab[i,j] /* WRONG */

Other than this notational distinction, a two-dimensional array can be
treated in much the same way as in other languages. Elements are
stored by rows, so the rightmost subscript, or column, varies fastest
as elements are accessed in storage order.

William Thompson
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL licenses in Windows
Next Topic: Re: Multiple file selector?

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

Current Time: Wed Oct 08 19:15:56 PDT 2025

Total time taken to generate the page: 0.00462 seconds