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

Home » Public Forums » archive » Re: 9 dimensions arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: 9 dimensions arrays [message #41860] Mon, 06 December 2004 21:09
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <MPG.1c1eb6cc10c06fca98989b@news.frii.com>,
David Fanning <davidf@dfanning.com> wrote:

> Francois writes:
>
>> How to create nine dimensions (9D) arrays ?
>>
>> The command make_array takes only 8 dimensions...
>> It seems the same for intarr, fltarr, etc.
>
> That's right. Eight is the limit in IDL.

Well, you could make your own n-dimensional arrays by using
one-dimensional arrays and writing your own subscripting function, e.g.,

dims = [n1, n2, n3, n4, n5, n6, n7, n8, n9]
x = FLTARR(PRODUCT(dims))
x[MY_INDEX(i1, i2, i3, i4, i5, i6, i7, i8, i9, DIMS = dims)] = ...

The MY_INDEX function would convert from subscripts to 1-D array index
(what IDL does for normal subscripts internally).

Of course, it wouldn't be particularly fast. ;-)

Ken Bowman
Re: 9 dimensions arrays [message #41862 is a reply to message #41860] Mon, 06 December 2004 19:51 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mark Hadfield writes:

> And I am proud to report that I once wrote some code in which it would
> have been desirable to create arrays with 9 or 10 dimensions. I had to
> work around the limit by merging a few of them.

I *thought* about a 4D array once, but decided against it after
reading the Array Concatenation Tutorial again. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: 9 dimensions arrays [message #41864 is a reply to message #41862] Mon, 06 December 2004 19:45 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
David Fanning wrote:
> Francois writes:
>
>
>> How to create nine dimensions (9D) arrays ?
>>
>> The command make_array takes only 8 dimensions...
>> It seems the same for intarr, fltarr, etc.
>
>
> That's right. Eight is the limit in IDL.

And I am proud to report that I once wrote some code in which it would
have been desirable to create arrays with 9 or 10 dimensions. I had to
work around the limit by merging a few of them.

--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
Re: 9 dimensions arrays [message #41866 is a reply to message #41864] Mon, 06 December 2004 17:35 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Francois writes:

> How to create nine dimensions (9D) arrays ?
>
> The command make_array takes only 8 dimensions...
> It seems the same for intarr, fltarr, etc.

That's right. Eight is the limit in IDL.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL Broker
Next Topic: Re: IDL Broker

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

Current Time: Sat Oct 11 12:47:41 PDT 2025

Total time taken to generate the page: 0.40463 seconds