Skip to content

Instantly share code, notes, and snippets.

@GiulioRomualdi
Last active June 28, 2020 16:33
Show Gist options
  • Save GiulioRomualdi/b0b652e8fcddf02aedbf21ee4ad62264 to your computer and use it in GitHub Desktop.
Save GiulioRomualdi/b0b652e8fcddf02aedbf21ee4ad62264 to your computer and use it in GitHub Desktop.
/**
* @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