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

Home » Public Forums » archive » Re: About 2D array index
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: About 2D array index [message #62008] Fri, 15 August 2008 04:19
Juggernaut is currently offline  Juggernaut
Messages: 83
Registered: June 2008
Member
On Aug 14, 10:26 pm, xiao <littledd...@gmail.com> wrote:
> On Aug 14, 9:13 pm, David Fanning <n...@dfanning.com> wrote:
>
>
>
>> xiao writes:
>>> Can any one tell me how the index arranged? For example, An array
>>> like this :
>
>>> 10 13 14
>>> 59 13 20
>>> 45 9 12
>
>>> Is the index like this?
>
>>> 0 1 2
>>> 3 4 5
>>> 6 7 8
>
>>> Thank you~
>>> Actually , I tried to print the index and the result is like above but
>>> when I tried to large 2D array, it seems it is not right..........
>
>> It's right. :-)
>
>> Cheers,
>
>> David
>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> Thank you David~ :)

For a large array the type of array you are using may not have enough
numbers to reach the end.
If you use indgen(258, /byte) then the last two numbers in the array
will be 0 and 1 since it will cycle
back on itself seeing as how the limit of a number of type byte is 255.
Re: About 2D array index [message #62013 is a reply to message #62008] Thu, 14 August 2008 19:26 Go to previous message
xiao zhang is currently offline  xiao zhang
Messages: 81
Registered: June 2008
Member
On Aug 14, 9:13 pm, David Fanning <n...@dfanning.com> wrote:
> xiao writes:
>> Can any one tell me how the index arranged? For example, An array
>> like this :
>
>> 10 13 14
>> 59 13 20
>> 45 9 12
>
>> Is the index like this?
>
>> 0 1 2
>> 3 4 5
>> 6 7 8
>
>> Thank you~
>> Actually , I tried to print the index and the result is like above but
>> when I tried to large 2D array, it seems it is not right..........
>
> It's right. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Thank you David~ :)
Re: About 2D array index [message #62015 is a reply to message #62013] Thu, 14 August 2008 19:13 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
xiao writes:

> Can any one tell me how the index arranged? For example, An array
> like this :
>
> 10 13 14
> 59 13 20
> 45 9 12
>
> Is the index like this?
>
> 0 1 2
> 3 4 5
> 6 7 8
>
> Thank you~
> Actually , I tried to print the index and the result is like above but
> when I tried to large 2D array, it seems it is not right..........

It's right. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: About 2D array index
Next Topic: CUDA version of RANDOMN?

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

Current Time: Wed Oct 08 19:42:30 PDT 2025

Total time taken to generate the page: 0.00726 seconds