mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-03 06:50:57 +08:00
b0bd1cfa05
Use \verbinclude for output text to disable syntax highlighting. Give tables consistent look.
19 lines
368 B
C++
19 lines
368 B
C++
#include <Eigen/Dense>
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
using namespace Eigen;
|
|
|
|
int main()
|
|
{
|
|
Array33f m;
|
|
m << 1,2,3,
|
|
4,5,6,
|
|
7,8,9;
|
|
Array<float,5,5> n = Array<float,5,5>::Constant(0.6);
|
|
n.block(1,1,3,3) = m;
|
|
cout << "n = " << endl << n << endl << endl;
|
|
Array33f res = n.block(0,0,3,3) * m;
|
|
cout << "res =" << endl << res << endl;
|
|
}
|