[PYTHON MATRIX-SIG] Final conventions for alpha2

Konrad HINSEN hinsenk@ere.umontreal.ca
Mon, 19 Aug 1996 13:14:18 -0400


> Concatenation is reasonably efficient.  It could be better, but I'm
> holding off on any non-trivial efficiency improvements until after
> release 1.0.  Right now I think a solid, stable and reasonably complete
> implementation is much more important.
> 
> I don't see any good way to solve Carlos's problem using concatenation
> (without including arbitrary comparision functions for sort which I
> don't want to do).  How would you reccommend he gets the equivalent of:
> 
> ix=argsort(a)
> A=take(a,ix)
> B=take(b,ix)
> 
> for > 1d arrays without some take-like function?

Concatenation is indeed not what is needed, it is what APL
calls lamination (but it is implemented as a special case
of concatenation): the creation of a new axis along which 
the index 0 refers to a and the index 1 to b. Sort() then
reshuffles all elements automatically, and a simple indexing
recovers the sorted a and b.

Konrad.

-------------------------------------------------------------------------------
Konrad Hinsen                     | E-Mail: hinsenk@ere.umontreal.ca
Departement de chimie             | Tel.: +1-514-343-6111 ext. 3953
Universite de Montreal            | Fax:  +1-514-343-7586
C.P. 6128, succ. Centre-Ville     | Deutsch/Esperanto/English/Nederlands/
Montreal (QC) H3C 3J7             | Francais (phase experimentale)
-------------------------------------------------------------------------------

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

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