icpcにパスが通っている状態として,
https://eigen.tuxfamily.org/dox/GettingStarted.htmlに記載のプログラムを回してみる.
#include <iostream> #include <Eigen/Dense> using Eigen::MatrixXd; using Eigen::VectorXd; int main() { MatrixXd m = MatrixXd::Random(3,3); m = (m + MatrixXd::Constant(3,3,1.2)) * 50; std::cout << "m =" << std::endl << m << std::endl; VectorXd v(3); v << 1, 2, 3; std::cout << "m * v =" << std::endl << m * v << std::endl; }
出力はこんな感じ.
m = 94.0188 89.844 43.5223 49.4383 101.165 86.823 88.3099 29.7551 37.7775 m * v = 404.274 512.237 261.153