Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc. |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
On Thu, Jan 5, 2017 at 11:07 AM, Gael Guennebaud <gael.guennebaud@xxxxxxxxx> wrote:Is this iota comparison syntax standard in APL or elsewhere?I don't know much about APL, I've been inspired by this post:for the size-based version first+iota(size)*step, and then came up with the use of comparison operators to cover the aseq(first,last) version. Last Massimilliano's post seems to imply that APL also uses this strategy to define bounds...Just from googling around, I couldn't confirm APL allows this.We already established that iota is basically aseqn. I think the notational advantage is that you can omit the "first", "incr" parameter when they're not needed. Also you have a natural notation for the common case where incr is fixed<-1>, just put "-" in front of iota.aseqn(0, n) = iota(n)aseqn(0, n, fix<-1>) = -iota(n)aseqn(0, n, s) = iota(n) * saseqn(a, ...) = a + ...We now just need a syntax to cover aseq. But I really don't think "<" is a good choice.If we view the result of iota and iota(n) as a pseudo vector, then the meaning of iota < C should not be different from v < C where v is a regular vector. Assume we still want to allow boolean mask indexing of the form v[v >= 3 && v < 5] to work, then v < C is a boolean vector.
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |