[Matrix-SIG] thoughts about the future

Janko Hauser jhauser@ifm.uni-kiel.de
Mon, 10 Jan 2000 22:17:18 +0100 (CET)


--myGD1QTv+O
Content-type: text/plain; charset="us-ascii"
Content-transfer-encoding: 7bit
Content-Description: message body text

Regarding ``range objects''. Partly we have already such things with
the slice object. So you can write:

var=ones((50,10,20))
a=RangeObject[:30,0,:-10]

var[a]

It's written by Konrad Hinsen. I append the class which he calls
``indexing''. This needs to be extended if something like gathering is
implemented. Despites his comment it does work with:

[...],[:,3],[3,-3,...]

__Janko


--myGD1QTv+O
Content-type: application/octet-stream
Content-transfer-encoding: base64
Content-Disposition: attachment;
	filename="indexing.py"

IyBBIG5pY2VyIHdheSB0byBidWlsZCB1cCBpbmRleCB0dXBsZXMgZm9yIGFycmF5cy4KIwoj
IFlvdSBjYW4gZG8gYWxsIHRoaXMgd2l0aCBzbGljZSgpIHBsdXMgYSBmZXcgc3BlY2lhbCBv
YmplY3RzLAojIGJ1dCB0aGVyZSdzIGEgbG90IHRvIHJlbWVtYmVyLiBUaGlzIHZlcnNpb24g
aXMgc2ltcGxlciBiZWNhdXNlCiMgaXQgdXNlcyB0aGUgc3RhbmRhcmQgYXJyYXkgaW5kZXhp
bmcgc3ludGF4LgojCiMgRm9yIGFueSBpbmRleCBjb21iaW5hdGlvbiwgaW5jbHVkaW5nIHNs
aWNpbmcgYW5kIGF4aXMgaW5zZXJ0aW9uLAojIGFbaW5kaWNlc10gaXMgdGhlIHNhbWUgYXMg
YVtpbmRleF9leHByZXNzaW9uW2luZGljZXNdXS4gSG93ZXZlciwKIyBpbmRleF9leHByZXNz
aW9uW2luZGljZXNdIGNhbiBiZSB1c2VkIGFueXdoZXJlIGluIFB5dGhvbiBjb2RlCiMgYW5k
IHJldHVybnMgYSB0dXBsZSBvZiBpbmRleGluZyBvYmplY3RzIHRoYXQgY2FuIGJlIHVzZWQg
aW4gdGhlCiMgY29uc3RydWN0aW9uIG9mIGNvbXBsZXggaW5kZXggZXhwcmVzc2lvb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