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 <
[email protected]> 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
> >
> > [0] https://github.com/headmyshoulder/odeint-v2/issues/194
> > [1] https://github.com/headmyshoulder/odeint-v2/pull/237
> >
>
>
> --
>   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:   [email protected]
>
>   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
>   -----------------------------------------------------------------------
>
>
>

Reply via email to