|[eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Thu, 22 Dec 2016 11:49:47 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=iU4wE8EGlqHZowd7ZUMbFiyDc6uPqOWlqR1D4DlMO/w=; b=HfJ40x1zbV316XRsQnmRPYUWWUWBel/ONrjH/iN69jE3w435CM/Q+6a7Ma0QowvCzI eX8TI5mPm6DT/GwFp4re3wvdbbFHKKL1mE9hLq/Ll5ohItjgWiHlh1CX4uMBnuEL66j0 L90ayv70qm2Iunkzc/Ug5E/F+JxQ1oRPn7RYHf2w7AZT4kgkPNn6jYzjcc1HMgC0uQwY Bsvlw+U33fttm+zodt/z4WnMdM1d0+dxnoOorCpnDlY9MHH2wr5GTmHAxk/fB03LbRQc XKZbi9AALgjZmEBvkFYGVfl6V49ImYbtlb6Q84mQbUgmc+s3+CeuZ3w0qWEr/6gj5qRb GXpw==
this is probably one of the most awaited feature that is still shamefully missing in Eigen. So let's have it for 3.4!
To this end, we first have to converge an API that will be unanimously adopted by the community. The challenge is to maximize expressivity, extensibility, concision, optimization opportunities, while avoiding ambiguities.
To help discussion, I've prepare this wiki page that contains a compilable c++ example demonstrating some ideas:
Speaking about "ambiguous" API, I hate the current MatrixXd::Constant(....) and VectorXd::LinSpaced(...) function: I never managed to remember the parameter orders, do the sizes come first? or last? I guess this is because the two answers make sense: one is consistent when moving from Constant to Ones, and the other when moving from Matrix to Vector or fixed-size object. This is thus a high source of hard to track bugs. I'd really like to avoid this caveat.