threed-beam-fea/ext/eigen-3.2.4/doc/examples/QuickStart_example2_dynamic...

16 lines
305 B
C++
Raw Normal View History

2015-11-05 19:36:26 +01:00
#include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXd m = MatrixXd::Random(3,3);
m = (m + MatrixXd::Constant(3,3,1.2)) * 50;
cout << "m =" << endl << m << endl;
VectorXd v(3);
v << 1, 2, 3;
cout << "m * v =" << endl << m * v << endl;
}