Re: [eigen] Comma-initializer is quite expensive with compile-time known constants |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Comma-initializer is quite expensive with compile-time known constants*From*: Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx>*Date*: Mon, 5 Nov 2018 15:57:56 +0100

On 2018-11-05 15:34, Ola Røer Thorsen wrote:

Hi, we're using fixed-size Eigen matrices (eigen 3.3.5), mostly 3-element-vectors, quaternions and 3x3 matrices but also larger ones. We've been initializing them with the comma initializer, but looking at the assembly produced the compiler (gcc 7) is not able to optimize everything away even for small code like Eigen::Vector3f v; v << 1,2,3; example: https://godbolt.org/z/y5YUnJ

Comparison: https://godbolt.org/z/ujpwVU

[...] Would it be possible to add some C++11 (or 14) feature to help in this regard? Not sure if you want to keep Eigen completely free of C++11-features. I've tried some variadic template "make_matrix" functions that seem to do the trick, not having to do the error checks runtime. Ideally, it would be nice to be able to write stuff like const Eigen::Matrix3f m{ 1,2,3, 4,5,6, 7,8,9 };

Yes, this had been discussed a while ago: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=954 We are not strictly "C++03 only" anymore.

Also, how to compose more complex expressions from existing sub-matrices: // how to mark that A21 starts a new row? Eigen::MatrixXf A{ A11, A12, A21, A22}; Eigen::MatrixXf A{ {A11, A12}, {A21, A22}}; Christoph -- Dr.-Ing. Christoph Hertzberg Besuchsadresse der Nebengeschäftsstelle: DFKI GmbH Robotics Innovation Center Robert-Hooke-Straße 5 28359 Bremen, Germany Postadresse der Hauptgeschäftsstelle Standort Bremen: DFKI GmbH Robotics Innovation Center Robert-Hooke-Straße 1 28359 Bremen, Germany Tel.: +49 421 178 45-4021 Zentrale: +49 421 178 45-0 E-Mail: christoph.hertzberg@xxxxxxx Weitere Informationen: http://www.dfki.de/robotik ----------------------------------------------------------------------- Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vorsitzender) Dr. Walter Olthoff Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes Amtsgericht Kaiserslautern, HRB 2313 Sitz der Gesellschaft: Kaiserslautern (HRB 2313) USt-Id.Nr.: DE 148646973 Steuernummer: 19/672/50006 -----------------------------------------------------------------------

**Follow-Ups**:**Re: [eigen] Comma-initializer is quite expensive with compile-time known constants***From:*Ola Røer Thorsen

**References**:**[eigen] Comma-initializer is quite expensive with compile-time known constants***From:*Ola Røer Thorsen

**Messages sorted by:**[ date | thread ]- Prev by Date:
**[eigen] Comma-initializer is quite expensive with compile-time known constants** - Next by Date:
**Re: [eigen] Comma-initializer is quite expensive with compile-time known constants** - Previous by thread:
**[eigen] Comma-initializer is quite expensive with compile-time known constants** - Next by thread:
**Re: [eigen] Comma-initializer is quite expensive with compile-time known constants**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |