Re: [eigen] Comma initializing a very big matrix

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


On 2024-04-05 01:01, Ian Bell wrote:
Is there a way to (in order of niceness):
1. Get the comma init to work

Using the comma-initializer results in a call-graph like:

    operator,(operator,(...,
        operator,(operator<<(MatrixXd,double),
        ...), double), double)

With a 45*45 call-depth this may stress your compiler more than it is capable. I would use the comma-initializer only if you need C++03 compatibility or to compose larger matrices from (a few!) sub-matrices.

2. Do a less-annoying workaround

I suggest using much more readable initializer lists:

    const Eigen::MatrixXd kernel_1{
        {0.0, 0.01, 0.02, ..., 0.44},
        {1.0, 1.01 ,1.02, ..., 1.44},
        ...
    };


3. At least crash with some sort of useful message

I guess that is a compiler issue. We can't do much from Eigen's side.

Christoph


--
 Dr.-Ing. Christoph Hertzberg

 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 für Künstliche Intelligenz GmbH
  Trippstadter Straße 122, 67663 Kaiserslautern, Germany

  Geschäftsführung:
  Prof. Dr. Antonio Krüger (Vorsitzender)
  Helmut Ditzer

  Vorsitzender des Aufsichtsrats:
  Dr. Ferri Abolhassan
  Amtsgericht Kaiserslautern, HRB 2313
  -------------------------------------------------------------




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