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

Home » Public Forums » archive » Re: Array indexing problem
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: Array indexing problem [message #37848] Thu, 29 January 2004 15:21 Go to previous message
kashyap is currently offline  kashyap
Messages: 26
Registered: April 1993
Junior Member
In article <MPG.1a81e83474fc47e19897be@news.frii.com>,
David Fanning <david@dfanning.com> wrote:
> Michael Wallace writes:
>
> Maybe we can hear from someone who uses it.
>
> Cheers,
>
> David

I use this feature quite a lot, for instance, to
define an array of a different size using a set
of indices where said indices may overflow (happens
all the time), and all I may want at these overflow
points is some default value.

Example: suppose there is an array of element
abundances (say ABUND, with size 30). And a
set of indices indicating the atomic number
(say Z, of size 10386). I want to make a new
array (AZ, of size 10386) which contains the
abundances for each of the Z[i]. Now further
suppose that in some places Z may be 0 or -1,
and for which I simply want to set the abundance
to 1. There are no doubt other ways of doing
this, but AZ=ABUND[Z-1] works fast, transparently,
AND stays readable.

Vinay
--
____________________________________________________________ __________________
kashyap@head-cfa.harvard.edu 617 495 7173 [CfA/P-143] 617 496 7173 [F]
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: V5.6 to V6.0 license server question
Next Topic: Rapid "moving windows" access in IDL?

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

Current Time: Wed Oct 08 19:10:45 PDT 2025

Total time taken to generate the page: 0.00486 seconds