Tutorial_BlockOperations_block_assignment.cpp
Go to the documentation of this file.
00001 #include <Eigen/Dense>
00002 #include <iostream>
00003 
00004 using namespace std;
00005 using namespace Eigen;
00006 
00007 int main()
00008 {
00009   Array22f m;
00010   m << 1,2,
00011        3,4;
00012   Array44f a = Array44f::Constant(0.6);
00013   cout << "Here is the array a:" << endl << a << endl << endl;
00014   a.block<2,2>(1,1) = m;
00015   cout << "Here is now a with m copied into its central 2x2 block:" << endl << a << endl << endl;
00016   a.block(0,0,2,3) = a.block(2,1,2,3);
00017   cout << "Here is now a with bottom-right 2x3 block copied into top-left 2x2 block:" << endl << a << endl << endl;
00018 }


libicr
Author(s): Robert Krug
autogenerated on Mon Jan 6 2014 11:33:55