[MATRIX-SIG] A proposal (LONG) - "reverse of take"

Phil Austin phil@geog.ubc.ca
Wed, 2 Jul 1997 19:29:28 -0700


>>>>> "AM" == Andrew P Mullhaupt <amullhau@ix.netcom.com> writes:

    AM> As to how good it is, you can get an indication of how useful
    AM> this sort of thing is by the fact that several interpreters
    AM> which had strict limits on indexing (APL at various stages,
    AM> Matlab until the most recent version, Speakeasy) were _forced_
    AM> by their user communities to extend the indexing operation
    AM> over time. Pascal and C, in every other sense far better
    AM> languages than Fortran IV, didn't put a _dent_ in the
    AM> scientific computing community for a _very long time_ because
    AM> they absolutely sucked for arrays. (C still does).


And C++ scientific programmers have adopted the Fortran90 Index
notation.  Here's part of a demo from Dan Quinlan's A++ array
package--i and j are vectors:

void PDE::Nine_Point_Stencil ( Index & i , Index & j )
   {
     Solution (i,j) = ( (Mesh_Size * Mesh_Size) * Right_Hand_Side (i,j) + 
                        Solution (i+1,j) + Solution (iFrom owner-matrix-sig@python.org	Thu Jul  3 09:42:10 1997
Received: (from majordom@localhost) by python.org (8.7.5/8.7.3)id JAA10638 for matrix-sig-people; Thu, 3 Jul 1997 09:41:56 -0400 (EDT)
Received: from ibs.ibs.fr (ibs.ibs.fr [192.134.36.253]) by python.org (8.7.5/8.7.3) with SMTPid JAA10633 for <matrix-sig@python.org>; Thu, 3 Jul 1997 09:41:53 -0400 (EDT)
Received: from lmspc1.ibs.fr (hinsen@lmspc1.ibs.fr [192.134.36.141]) by ibs.ibs.fr (8.6.12/8.6.12) with ESMTP id PAA26170; Thu, 3 Jul 1997 15:37:42 +0200
Received: (from hinsen@localhost)
	by lmspc1.ibs.fr (8.8.5/8.8.5) id PAA07644;
	Thu, 3 Jul 1997 15:36:25 +0200
Date: Thu, 3 Jul 1997 15:36:25 +0200
Message-Id: <199707031336.PAA07644@lmspc1.ibs.fr>
From: Konrad Hinsen <hinsen@ibs.ibs.fr>
To: arw@dante.mh.lucent.com
CC: arw@mh.lucent.com, matrix-sig@python.org
In-reply-to: <199707031209.IAA28794@dante.mh.lucent.com>
	(arw@dante.mh.lucent.com)
Subject: Re: [MATRIX-SIG] reverse of take?
Sender: owner-matrix-sig@python.org
Precedence: bulk

> Ok, this gets fun.  Are we talking about a "pointer array"?
> IE an array of *references* into another array?  One could

Right.

> even imagine an array of references into several different
> arrays, but the refcounting issues might get complicated here...

Indeed, and how would you create such an array? By combined indexing
from two arrays? I don't think that makes much sense...

> Actually, maybe an array of references into one other array
> might not look too different from the current implementation
> -- just like the current array implementation, but storing pointers

Exactly. The current array implementation basically knows two kinds
of objects: an "array data" object, which users don' see directly,
and an "array reference" object, which stores a pointer to the data
object plus information on the arrangement of elements (first & last
index plus stride for each dimension). Indexing creates a new reference
object, which refers to the same data object.

So what we are talking about now is an alternative implementation of
the reference object which musts store more than just three numbers
per dimension. There are several possible implementations; I suppose
the easiest is a list of integer indices per dimension, referring to
the array data object.

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                          | E-Mail: hinsen@ibs.ibs.fr
Laboratoire de Dynamique Moleculaire   | Tel.: +33-4.76.88.99.28
Institut de Biologie Structurale       | Fax:  +33-4.76.88.54.94
41, av. des Martyrs                    | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France         | Nederlands/Francais
-------------------------------------------------------------------------------

_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________