Re: [eigen] Comma initializing a very big matrix |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Comma initializing a very big matrix
- From: Christoph Hertzberg <chtz@xxxxxxxxxxxxx>
- Date: Mon, 15 Apr 2024 15:46:51 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=uni-bremen.de; s=2019; t=1713188811; bh=2f8buUYt9MFQa/nSkHuF4My5JvhKAGE3YKcqLOnvHmk=; h=Date:Subject:To:References:From:In-Reply-To; b=nxGjHZOrhbkPFaYAz1zfmkdoe1N0tEORTkpyOn4N2G9VfB8arqotCgw02Vw3GYk0y SlBAAtiSQhNh2lJjzbeAgXMSMXEs9qR9XlUK0sdAC/+Kh/wwv77xbJKZjuTQapWqHo oBlA4bAEvttWp10IxB1jXIr+nr6pl+ILLwuyMHr2lMfXfz/rdZuaQfXkdV9YdUlIDI poeXWGSGhJTfaSpcvjXEviz582IKJb7rn+3valNA5ctdh/Wl0AzCT1R48vnj5wRQdd 9orO8/QHpAxka//QyGtS76ICPkS8HH0nuA/A1i7xvZquqfAUsw0rCJUTeUZZLfQy0J HpiTqDwYfojYg==
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
-------------------------------------------------------------