[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Best way to handle matrixes with Oberon



Is there anything wrong with just allocating arrays which are one element
larger than
you need and then just ignoring the zeroth element?  I did this when I
converted some
algorithms from Fortran into Oberon-2 and it seemed to work fairly well for
me.
 
Michael Griebling

-----Original Message-----
From: Didier MATHIEU [mailto:mathieu@ripault.cea.fr]
Sent: Friday, July 16, 1999 12:16 PM
To: ooc-list@informatik.uni-kl.de
Subject: Best way to handle matrixes with Oberon


I find Oberon-2 very attractive, but I was reluctant because it seems to be
completely ignored in the chemical physics community. 
Moreover, I am displeased by a few details. For instance, I find it very
natural to start indexes and ONE instead of ZERO for arrays and matrixes,
much employed in numerical schemes. In C, I simply shift the pointers, along
with casts for multidimensional arrays - and everything works fine. However,
it seems that such pointer arithmetics is not consistent with more modern
approaches to programming ? The correct approach might be to access every
element of the matrix or vector through a user-defined method, but it
implies a heavy syntax and - more seriously - I fear it would not be very
efficient. 
I guess that the possibility to start at arbitrary indexes should not be a
relevant feature as it has been removed in Oberon-2, but what is the best
(CONVENIENT and EFFICIENT) approach instead ?