[PYTHON MATRIX-SIG] RubberIndex

Chris Chase S1A chris.chase@jhuapl.edu
Mon, 4 Mar 1996 11:01:34 +0500


>>>>> "Konrad" == Konrad HINSEN <hinsenk@ere.umontreal.ca> writes:

Chase>    both selection and assignment.  This specific solution for
Chase>    flattened indexing is supported in all the array languages
Chase>    that I have had exposure to (e.g. Matlab, IDL, Tela,
Chase>    Yorick). To me this is more important than the hierarchical
Chase>    indexing scheme so that an array looks like a list (but does
Chase>    not act like a list for other purposes).

Konrad> The array languages I am familiar with (APL and J) do not
Konrad> permit this.

I forgot about my brief experience with APL-PLUS.

Chase>    As an alternative, a 'flat' (or 'flattened') array attribute
Chase>    could be supported.

Konrad> Why? What's wrong with ravel(a)? You can index its result if
Konrad> you want.

The reason for a 'flat' attribute is that ravel(a) does not support
_assignment_ to 'a' in flattened form.  An attribute or method is a
more natural interface for changing an objects data members.  However,
ravel(a) could provide this functionality if ravel(a) returned a
reference instead of a copy.

The attribute would not fit your functions for everything so that
scalars can be substituted for arrays. But if the flattened array is
to be indexed (for assignment or selection) then scalars could not be
supported anyway.

Chris


=================
MATRIX-SIG  - SIG on Matrix Math for Python

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