Last active
June 28, 2020 16:33
-
-
Save GiulioRomualdi/b0b652e8fcddf02aedbf21ee4ad62264 to your computer and use it in GitHub Desktop.
Test Eigen Alignement issue http://eigen.tuxfamily.org/dox-devel/group__TopicStructHavingEigenMembers.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file eigen_test.cpp | |
* @authors Giulio Romualdi | |
* @copyright This software may be modified and distributed under the terms of the GNU Lesser | |
* General Public License v2.1 or any later version. | |
* @date 2020 | |
*/ | |
// Please compile the file with c++17 | |
// e.g. g++ -mavx -std=c++17 -o eigen_test -I/usr/include/eigen3/ ./eigen_test.cpp | |
#include <Eigen/Dense> | |
class Foo { | |
Eigen::Vector4d v; | |
public: | |
Eigen::Vector4d &getV() { return v; } | |
const Eigen::Vector4d &getV() const { return v; } | |
}; | |
int main() { | |
Foo *foo = new Foo; | |
foo->getV() << 1, 2, 3, 4; | |
delete foo; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment