digitalmars.D.announce - N-dimensional slices is ready for comments!
- Ilya Yaroshenko (9/9) Jun 15 2015 Hi All,
- Manu via Digitalmars-d-announce (4/12) Jun 15 2015 Is awesome!
- Denis Shelomovskij (5/13) Jun 15 2015 http://forum.dlang.org/post/l315jb$avg$1@digitalmars.com
- Denis Shelomovskij (7/22) Jun 15 2015 Sorry, this was the last one:
- Ilya Yaroshenko (2/24) Jun 15 2015 Thanks! I will ask you to do review after few additions :)
- jmh530 (20/29) Jun 18 2015 The operator overloading and slicing mechanics look great, but
- Ilya Yaroshenko (17/50) Jun 19 2015 You can slice fixed size arrays:
- Vlad Levenfeld (9/64) Jun 19 2015 https://github.com/evenex/autodata
- Vlad Levenfeld (2/11) Jun 19 2015 and the dub package: http://code.dlang.org/packages/autodata
- Ilya Yaroshenko (9/21) Jun 20 2015 autodata is hard to understand without HTML documentation.
- Vlad Levenfeld (7/15) Jul 11 2015 Thanks for the info. I have now documented the lib (and its
- jmh530 (17/24) Jun 21 2015 After playing around with some stuff more, I keep finding the
Hi All, PR and Examples: https://github.com/D-Programming-Language/phobos/pull/3397 DUB http://code.dlang.org/packages/dip80-ndslice N-dimensional slices is real world example where `static foreach` would be useful. Corresponding lines was marked with //TODO: static foreach Best regards, Ilya
Jun 15 2015
Is awesome! Incidentally, I've been needing static foreach a lot the last few days too. On 15 June 2015 at 18:40, Ilya Yaroshenko via Digitalmars-d-announce <digitalmars-d-announce puremagic.com> wrote:Hi All, PR and Examples: https://github.com/D-Programming-Language/phobos/pull/3397 DUB http://code.dlang.org/packages/dip80-ndslice N-dimensional slices is real world example where `static foreach` would be useful. Corresponding lines was marked with //TODO: static foreach Best regards, Ilya
Jun 15 2015
15.06.2015 11:40, Ilya Yaroshenko пишет:Hi All, PR and Examples: https://github.com/D-Programming-Language/phobos/pull/3397 DUB http://code.dlang.org/packages/dip80-ndslice N-dimensional slices is real world example where `static foreach` would be useful. Corresponding lines was marked with //TODO: static foreach Best regards, Ilyahttp://forum.dlang.org/post/l315jb$avg$1 digitalmars.com -- Денис В. Шеломовский Denis V. Shelomovskij
Jun 15 2015
16.06.2015 1:11, Denis Shelomovskij пишет:15.06.2015 11:40, Ilya Yaroshenko пишет:Sorry, this was the last one: "Finally full multidimensional arrays support in D" http://forum.dlang.org/thread/lg7c0t$jmg$1 digitalmars.com -- Денис В. Шеломовский Denis V. ShelomovskijHi All, PR and Examples: https://github.com/D-Programming-Language/phobos/pull/3397 DUB http://code.dlang.org/packages/dip80-ndslice N-dimensional slices is real world example where `static foreach` would be useful. Corresponding lines was marked with //TODO: static foreach Best regards, Ilyahttp://forum.dlang.org/post/l315jb$avg$1 digitalmars.com
Jun 15 2015
On Monday, 15 June 2015 at 22:17:12 UTC, Denis Shelomovskij wrote:16.06.2015 1:11, Denis Shelomovskij пишет:Thanks! I will ask you to do review after few additions :)15.06.2015 11:40, Ilya Yaroshenko пишет:Sorry, this was the last one: "Finally full multidimensional arrays support in D" http://forum.dlang.org/thread/lg7c0t$jmg$1 digitalmars.comHi All, PR and Examples: https://github.com/D-Programming-Language/phobos/pull/3397 DUB http://code.dlang.org/packages/dip80-ndslice N-dimensional slices is real world example where `static foreach` would be useful. Corresponding lines was marked with //TODO: static foreach Best regards, Ilyahttp://forum.dlang.org/post/l315jb$avg$1 digitalmars.com
Jun 15 2015
On Monday, 15 June 2015 at 08:40:31 UTC, Ilya Yaroshenko wrote:Hi All, PR and Examples: https://github.com/D-Programming-Language/phobos/pull/3397 DUB http://code.dlang.org/packages/dip80-ndslice N-dimensional slices is real world example where `static foreach` would be useful. Corresponding lines was marked with //TODO: static foreach Best regards, IlyaThe operator overloading and slicing mechanics look great, but I'm probably more excited about the future work you have listed. Some thoughts: The top line of ndslice.d says it is for "creating n-dimensional random access ranges". I was able to get the example for operator overloading working for dynamic arrays, but it doesn't seem to work for static. Hopefully this work can be extended. In addition, hopefully the future work on foreach byElement will be able to work on static arrays in addition to dynamic. My second point seems to be related to a discussion on the github page about accessing N-dimensional arrays by index. Basically there are some circumstances where it is convenient to loop by index on an N-dimensional array. Finally, I have been trying to do something like auto A = 4.iota.sliced(2, 2).array; auto B = to!(float[][])(A); without any luck. Seems to work though for one-dimensional arraays. I think instead you have to do something like auto A = iota(0.0f, 4.0f, 1).sliced(2, 2).array;
Jun 18 2015
On Friday, 19 June 2015 at 01:46:05 UTC, jmh530 wrote:On Monday, 15 June 2015 at 08:40:31 UTC, Ilya Yaroshenko wrote:You can slice fixed size arrays: auto myFun() { float[4096] data; auto tensor = data[].sliced(256, 16); ///use tensor }Hi All, PR and Examples: https://github.com/D-Programming-Language/phobos/pull/3397 DUB http://code.dlang.org/packages/dip80-ndslice N-dimensional slices is real world example where `static foreach` would be useful. Corresponding lines was marked with //TODO: static foreach Best regards, IlyaThe operator overloading and slicing mechanics look great, but I'm probably more excited about the future work you have listed. Some thoughts: The top line of ndslice.d says it is for "creating n-dimensional random access ranges". I was able to get the example for operator overloading working for dynamic arrays, but it doesn't seem to work for static. Hopefully this work can be extended. In addition, hopefully the future work on foreach byElement will be able to work on static arrays in addition to dynamic.My second point seems to be related to a discussion on the github page about accessing N-dimensional arrays by index. Basically there are some circumstances where it is convenient to loop by index on an N-dimensional array.Denis had the same concept already implemented in his `unstd` library. So, ndslice is going to have it too.Finally, I have been trying to do something like auto A = 4.iota.sliced(2, 2).array; auto B = to!(float[][])(A); without any luck. Seems to work though for one-dimensional arraays. I think instead you have to do something like auto A = iota(0.0f, 4.0f, 1).sliced(2, 2).array;Thanks! I will add this kind of functionality: auto A = 4.iota.sliced(2, 2); auto B = cast(float[][]) A; import std.conv; auto C = A.to!(float[][]); //calls opCast
Jun 19 2015
On Friday, 19 June 2015 at 10:13:42 UTC, Ilya Yaroshenko wrote:On Friday, 19 June 2015 at 01:46:05 UTC, jmh530 wrote:https://github.com/evenex/autodata N-dimensional slicing, range ops (map, zip, repeat, cycle, etc) lifted to n-dimensions, n-dim specific ops like extrusion, n-dim to d-dim of n-1-dim, flattening for lexicographic traversal, support for non-integer indices. I posted this awhile ago but no one took notice. But if this is happening here now, feel free to crib anything that you think might look useful, as I'd hate to think all of this prior work went to waste.On Monday, 15 June 2015 at 08:40:31 UTC, Ilya Yaroshenko wrote:You can slice fixed size arrays: auto myFun() { float[4096] data; auto tensor = data[].sliced(256, 16); ///use tensor }Hi All, PR and Examples: https://github.com/D-Programming-Language/phobos/pull/3397 DUB http://code.dlang.org/packages/dip80-ndslice N-dimensional slices is real world example where `static foreach` would be useful. Corresponding lines was marked with //TODO: static foreach Best regards, IlyaThe operator overloading and slicing mechanics look great, but I'm probably more excited about the future work you have listed. Some thoughts: The top line of ndslice.d says it is for "creating n-dimensional random access ranges". I was able to get the example for operator overloading working for dynamic arrays, but it doesn't seem to work for static. Hopefully this work can be extended. In addition, hopefully the future work on foreach byElement will be able to work on static arrays in addition to dynamic.My second point seems to be related to a discussion on the github page about accessing N-dimensional arrays by index. Basically there are some circumstances where it is convenient to loop by index on an N-dimensional array.Denis had the same concept already implemented in his `unstd` library. So, ndslice is going to have it too.Finally, I have been trying to do something like auto A = 4.iota.sliced(2, 2).array; auto B = to!(float[][])(A); without any luck. Seems to work though for one-dimensional arraays. I think instead you have to do something like auto A = iota(0.0f, 4.0f, 1).sliced(2, 2).array;Thanks! I will add this kind of functionality: auto A = 4.iota.sliced(2, 2); auto B = cast(float[][]) A; import std.conv; auto C = A.to!(float[][]); //calls opCast
Jun 19 2015
On Friday, 19 June 2015 at 21:43:59 UTC, Vlad Levenfeld wrote:https://github.com/evenex/autodata N-dimensional slicing, range ops (map, zip, repeat, cycle, etc) lifted to n-dimensions, n-dim specific ops like extrusion, n-dim to d-dim of n-1-dim, flattening for lexicographic traversal, support for non-integer indices. I posted this awhile ago but no one took notice. But if this is happening here now, feel free to crib anything that you think might look useful, as I'd hate to think all of this prior work went to waste.and the dub package: http://code.dlang.org/packages/autodata
Jun 19 2015
On Friday, 19 June 2015 at 21:45:18 UTC, Vlad Levenfeld wrote:On Friday, 19 June 2015 at 21:43:59 UTC, Vlad Levenfeld wrote:autodata is hard to understand without HTML documentation. Automated documentation based on https://github.com/kiith-sa/harbored-mod can be found at http://ddocs.org/autodata/~master/index.html, and it is empty. You may want to read http://dlang.org/ddoc.html Regards, Ilyahttps://github.com/evenex/autodata N-dimensional slicing, range ops (map, zip, repeat, cycle, etc) lifted to n-dimensions, n-dim specific ops like extrusion, n-dim to d-dim of n-1-dim, flattening for lexicographic traversal, support for non-integer indices. I posted this awhile ago but no one took notice. But if this is happening here now, feel free to crib anything that you think might look useful, as I'd hate to think all of this prior work went to waste.and the dub package: http://code.dlang.org/packages/autodata
Jun 20 2015
On Saturday, 20 June 2015 at 09:17:22 UTC, Ilya Yaroshenko wrote:autodata is hard to understand without HTML documentation. Automated documentation based on https://github.com/kiith-sa/harbored-mod can be found at http://ddocs.org/autodata/~master/index.html, and it is empty. You may want to read http://dlang.org/ddoc.html Regards, IlyaThanks for the info. I have now documented the lib (and its dependencies) and pushed the updates, but the ddocs site seems to be down for me, so I can't see if the docs have made their way to the site. In any case, you can take a look if you like, once the site is working again.
Jul 11 2015
On Friday, 19 June 2015 at 10:13:42 UTC, Ilya Yaroshenko wrote:You can slice fixed size arrays: auto myFun() { float[4096] data; auto tensor = data[].sliced(256, 16); ///use tensor }After playing around with some stuff more, I keep finding the syntax for the static and dynamic arrays confusing (more general to D than your code). It just seems weird that you have to treat them differently when applying a function to them. Also, whenever you have an expanlation point followed by a type that could be an array, you need to make sure to put parentheses around it. For instance, to!(real[])(x); instead of to!real[](x); or auto fp = &function!(real[]); instead of auto fp = &function!real[]; I wish the documentation made it a bit more clear that you have to do this.
Jun 21 2015