#include#include int main() { Eigen::Matrix4f m; m << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16; std::cout << m << std::endl; return 0; }
#includeIn this example, two Matrix4f objects are created and initialized with values using the << operator. The product of these matrices is then assigned to another Matrix4f object using the * operator. The resulting matrix is printed to the console. Eigen is an open-source library for linear algebra and is distributed under the Mozilla Public Licence 2.0.#include int main() { Eigen::Matrix4f a, b, product; a << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16; b << 1, 2, 1, 2, 3, 4, 3, 4, 1, 2, 1, 2, 3, 4, 3, 4; product = a * b; std::cout << product << std::endl; return 0; }