Re: OONSTD: Element Ordering 2D Arrays

Gabriel Dos Reis (Gabriel.Dos-Reis@dptmaths.ens-cachan.fr)
Thu, 9 Jul 1998 18:14:35 +0200 (MET DST)

>>>>> «Roldan», Roldan Pozo <pozo@nist.gov> wrote:

Roldan> The 0/1 offset issue is one of those perpetual debates in numerical programming
Roldan> that no side will ever win. I have argued for both camps over the years, until
Roldan> I decided to just allow for both and be done with it.

I don't think 0/1 is the real issue.

>> So 1) is familiar to C programmers, and 2) is familiar to Fortran
>> programmers. That's cute, but has flaws:
>> A) How do you represent arrays with specified bounds? The
>> Fortran syntax dimension A(-4:4,-10:10).
>> B) Makes for lots of extra work for the container author.

Roldan> A) You don't. In practice, it's not a big deal.

valarray<> does provide operator[] for slice and generalized silce.

-- Gaby
Gabriel Dos Reis | École Normale Supérieure de Cachan
INRIA, Unité de Recherche de | Centre de Mathématiques et de Leurs
Sophia Antipolis | Applications
Projet SAGA | Équipe de Géométrie