Path: news.mathworks.com!newsfeed.mathworks.com!newstransit.mitre.org!news.mitre.org!not-for-mail
From: Stan Pawlukiewicz <stanp@mitre.org>
Newsgroups: comp.dsp,comp.soft-sys.matlab
Subject: Re: Dijkstra has died, and "Why Numbering Should Start At Zero"
Date: Thu, 15 Aug 2002 11:10:48 -0400
Organization: MITRE
Lines: 88
Message-ID: <3D5BC478.776C86A6@mitre.org>
References: <3D54338B.9CAE931D@ieee.org> <3D55B0F1.B21A82CC@ieee.org> <2ae8f62b.0208140017.65bb9cd3@posting.google.com> <aje1k0$8bi8@cui1.lmms.lmco.com> <3D5B2FFC.30331F0@surfglobal.net>
NNTP-Posting-Host: dauntless.mitre.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: newslocal.mitre.org 1029424248 3637 128.29.122.14 (15 Aug 2002 15:10:48 GMT)
X-Complaints-To: news@mitre.org
NNTP-Posting-Date: Thu, 15 Aug 2002 15:10:48 +0000 (UTC)
X-Mailer: Mozilla 4.79C-20000818M [en] (X11; U; Linux 2.4.17-18mdk i686)
X-Accept-Language: en
Xref: news.mathworks.com comp.dsp:131868 comp.soft-sys.matlab:133685



robert bristow-johnson wrote:
> 
> AJ \"no z\" Johnson wrote:
> >
> > "Steve Amphlett" <samphlett@ricardo.com> wrote in message
> > news:2ae8f62b.0208140017.65bb9cd3@posting.google.com...
> > > Oh well guys, the thread's now four days old and still no TMW
> > > chippers-in!  Do you reckon they're developing their killer argument?
> > > Or are they just sitting pretty, knowing that their obviously flawed
> > > product has market share on its side?
> > >
> > > - Steve
> >
> > ...or maybe they are too busy adding an "Index Origin" property to array
> > constructs. One can only hope. I hope it's obvious which court I'm in.
> 
> it's nice to feel less alone.  when i first brought this up, it seemed
> like everyone, except a few comp.dsp regulars, thought i was goofy.

Now, who... would think that. ;)


Responding to this and the another thread, here in one place.

Take a look at Python.  I haven't played with 2.2, but in 1.5 and with
numpy, there is a distinction between an array(n) and a
array(n,1).  You can also have an array with indicies

a('bob', 'ted', 'carol', 'alice') 

 if you want.  The iterator in this case brings a few ideas to mind, but
I won't go there.

It seems like you would like something of the flavor of an associate
memory.  

In terms of matricies, zero base indexing might be a bit cleaner in
terms of notation for cyclic objects i.e.  a( mod(i,N))  

 
> 
> > This being the first indexing thread that *I've* read, I am curious what
> > other languages support definable indexing origins?
> > For sure:
> > - Maple (don't know much about it, though)
> > - Pascal, IIRC
> > - APL (choice of 0 or 1 only)
> > - C (array indexing is so loose that one can implement non-zero based
> > indexing, but it is geneally considered bad coding practice)
> 
> i don't consider it bad coding practice, at all.  i used to do this:
> 
> double _my_dummy_array1[1024];
> double my_array[1];
> double _my_dummy_array2[1024];
> 
> for (k=-1024; k<=1024; k++)
>         {
>         do_something_with( my_array[k] );
>         }
> 
> ****but i was thoroughly chewed out for that since there was no way to
> guarantee that the compiler would put the arrays together like that.
> but if you do:
> 
> double *_my_dummy_array = (double *)malloc(2049*sizeof(double));
> double *my_array = _my_dummy_array + 1024;
> 
> for (k=-1024; k<=1024; k++)
>         {
>         do_something_with( my_array[k] );
>         }
> 
> ****that should be perfectly acceptable coding practice.
> 
> > I think Mathworks has gone a long way to meeting customer demands, which is
> > why it's such a comprehensive product now. If only they'd add *my* stuff...
> 
> elegance, consiseness, and simplicity is more important to me than
> everything with the kitchen sink.  i use very few of the huge set of
> MATLAB functions.  i just want them to work correctly.
> 
> --
> 
> r b-j
> rbj@surfglobal.net   a.k.a.   robert@wavemechanics.com
> 
> "Don't give in to the Dark Side.  Boycott intel and microsoft."