Re: [eigen] Eigen >= 3.3 and odeint
• To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
• Subject: Re: [eigen] Eigen >= 3.3 and odeint
• From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
• Date: Mon, 18 Mar 2019 11:58:27 +0100
• Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=G6rO5j0GHBJp41XyjpYJqPGIY4lqTAcXND5X1c2Pigk=; b=HSErX7O9FsZiQmaH4n0jftdXhPiL1zdqdhHq5hnpdrKtHfR0FZGd4Y4RkLP/Cplw2N zteygxlcZpW25AmcyGH6/DR3Pgzl/W2p1RK03EbGv8/0ZLPvAfZhbDnERwtWRzLSQAuY fjI2YYNZjpIrCTLGnBm77Lt46T/VfDfXhctESvsj1Cf+4d1vOehKnUzcCHxgXw5+J+gl QJwpp6vE1Lz96dO21PTH5MyeH/XPGao6S+fneQPSA11ohQMqentNoU4J907FNbLzePE/ WxEX6P7imSmaqIxZdw4LOz0Tb/FuEtUW2TAAkDJmpDVogyY4n7ogOJJQTNWX4Om06mlN evUg==

If you really want to support mat+scalar and can afford a c++11-only solution, then better use 'auto' and return:

(mat.array()+scalar).matrix()

Same for mat1/mat2.

gael

On Sun, Mar 17, 2019 at 12:07 PM Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi,

you are right that changing (or depending on) things in the internal
namespace is not a good idea, since these could change at any time (even
within the same major release).

I may not fully understand what you actually intend to do here, but if
you want to have a matrix-like type where you can simply add scalars
better use the `Array` class (which already existed in Eigen-3.2):
http://eigen.tuxfamily.org/dox/group__TutorialArrayClass.html
http://eigen.tuxfamily.org/dox-3.2/group__TutorialArrayClass.html

Adding scalars to matrices is intentionally not possible directly with
Eigen, e.g., since in some cases it would be more logical to just add
the scalar to the diagonal so that this identity holds:

(A+s)*B == (A+s*Identity)*B == A*B + s*B

But since this behavior could be surprising as well, we don't enable it
at all.

Cheers,
Christoph

On 17/03/2019 05.40, Dale Lukas Peterson wrote:
> Hello,
>   Using Eigen::Matrix for the state_type in odeint worked until a change in
> Eigen 3.3. Issue #194 [0] tracks the issue, including a recently merged
> patch [1] by one of the odeint maintainers to fix the issue.
>
> The patch [1] depends on the internal namespace of Eigen. Is there any
> guidance from an Eigen expert on how this patch might be changed to work
> without depending on Eigen::internal?
>
> Sincerely,
> Luke
>
>

--
Dr.-Ing. Christoph Hertzberg

DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

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
-----------------------------------------------------------------------

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