mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-24 02:29:33 +08:00
16 lines
337 B
C++
16 lines
337 B
C++
#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;
|
|
}
|