eigen/doc/examples/Tutorial_BlockOperations_block_assignment.cpp
Jitse Niesen b0bd1cfa05 Tutorial page 4: add some text, diversify examples.
Use \verbinclude for output text to disable syntax highlighting.
Give tables consistent look.
2010-07-14 10:16:12 +01:00

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;
}