ndslice: allow: a[ _, 9, R(2, $, -3)] as matlab's a[: ,9, reverse(2:3:end)) ]

Timothee Cour via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 8 16:26:42 PST 2016


i wrote my own tensor library a while ago and it allows the more convenient
matlab/python+numpy like syntax:

a[ _, 9, R(2, $, -3)]
these are allowed:
R() or _: full range for an index
R(a,b): a..b
R(a,b,s): when s>0, iota(a,b,s)
R(a,b,s): when s<0, iota(a,b,-s).reverse

Could we have this in ndslice?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20160108/964bbf4d/attachment.html>


More information about the Digitalmars-d mailing list