Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc. |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
I added a list of examples comparing aseq (inclusive), aseqn, a aseqX version with exclusive upper-bound, python, and the experimental "_expression_-based" API:From these examples, having aseq inclusive still seems to be more handy, and the size-based aseqn function is still there for some simple cases for which an exclusive upper-bound is more handy.They also show that having both a end and last "keyword" might be handy, but not mandatory.Finally, these examples also reveal that the "_expression_-based" API outperforms all other alternatives, in all cases. For instance, can you guess the intent from the following python code:A[:-(k-1)*s-2:-s] ?????compared to:A(last-iota(k)*s)??The solution is: "pick k elements from the last one with step s in descending order".For the record, the aseq-based version is:A(aseq(last,last-(k-1)*s,-s))
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |