UbuntuにEigenをインストールする方法



How Install Eigen Ubuntu



How to install Eigen under linux . 1.Installation: sudo apt-get install libeigen3-dev 2 Adjust, the default installation path is: /usr/include/eigen3 cd /usr/include/eigen3 ls $ Eigen signature_of_eigen3_matrix_library unsupported 3.Need to execute the copy command, put the Eigen folder under /usr/include sudo cp Eigen/ .. -R 4. Write files for testing vi myeigen.c #include <iostream> #include <Eigen/Dense> using Eigen::MatrixXd int main() { MatrixXd m(2,2) m(0,0) = 3 m(1,0) = 2.5 m(0,1) = -1 m(1,1) = m(1,0) + m(0,1) std::cout << m << std::endl } 5. Compile. g++ myeigen.c -o myeigen 6.run. ./myeigen 7. result. 3 -1 2.5 1.5