Tutorial_AdvancedInitialization_ThreeWays.cpp
Go to the documentation of this file.
00001 const int size = 6;
00002 MatrixXd mat1(size, size);
00003 mat1.topLeftCorner(size/2, size/2)     = MatrixXd::Zero(size/2, size/2);
00004 mat1.topRightCorner(size/2, size/2)    = MatrixXd::Identity(size/2, size/2);
00005 mat1.bottomLeftCorner(size/2, size/2)  = MatrixXd::Identity(size/2, size/2);
00006 mat1.bottomRightCorner(size/2, size/2) = MatrixXd::Zero(size/2, size/2);
00007 std::cout << mat1 << std::endl << std::endl;
00008 
00009 MatrixXd mat2(size, size);
00010 mat2.topLeftCorner(size/2, size/2).setZero();
00011 mat2.topRightCorner(size/2, size/2).setIdentity();
00012 mat2.bottomLeftCorner(size/2, size/2).setIdentity();
00013 mat2.bottomRightCorner(size/2, size/2).setZero();
00014 std::cout << mat2 << std::endl << std::endl;
00015 
00016 MatrixXd mat3(size, size);
00017 mat3 << MatrixXd::Zero(size/2, size/2), MatrixXd::Identity(size/2, size/2),
00018         MatrixXd::Identity(size/2, size/2), MatrixXd::Zero(size/2, size/2);
00019 std::cout << mat3 << std::endl;
00020 


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:33:27