New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
warning: advanced initialization in Eigen might confuse #429
Comments
You are right, this is a potential pitfall. Did this cause problems in some parts of the code? |
@Expander, this caused a problem for |
This is just eigen though, not sure what we can do other than not use the << incorrectly . Is it documented somewhere in eigen that it works this way? |
@uukhas I like your idea to tell the Eigen developers to put a brief note into their documentation to make the users aware of this issue. Formally, however, this is not a FS bug or similar. It's just something we need to be aware of. |
Yes I also agree with that. I also agree with @uukhas that putting a note in our wiki here to warn other FS people about it is also helpful. |
I have created the wiki page https://github.com/FlexibleSUSY/FlexibleSUSY/wiki/Eigen-library to warn us about this issue. |
There is the following way to initialize an array:
And the output is as one would assume:
So, I have immediately concluded that
<<
acts as=
, i.e. the right side is calculated at the same time and only then the substitution is done. This is WRONG:returns
and not
3 1
. So that every comma-separated element is calculated right after the update in correspondinga
element.The text was updated successfully, but these errors were encountered: