compile_Tutorial_AdvancedInitialization_ThreeWays.cpp
Go to the documentation of this file.
00001 #include <Eigen/Core>
00002 #include <Eigen/LU>
00003 #include <Eigen/QR>
00004 #include <Eigen/Cholesky>
00005 #include <Eigen/Geometry>
00006 #include <Eigen/Jacobi>
00007 #include <Eigen/Eigenvalues>
00008 #include <iostream>
00009 
00010 using namespace Eigen;
00011 using namespace std;
00012 
00013 int main(int, char**)
00014 {
00015   cout.precision(3);
00016   const int size = 6;
00017 MatrixXd mat1(size, size);
00018 mat1.topLeftCorner(size/2, size/2)     = MatrixXd::Zero(size/2, size/2);
00019 mat1.topRightCorner(size/2, size/2)    = MatrixXd::Identity(size/2, size/2);
00020 mat1.bottomLeftCorner(size/2, size/2)  = MatrixXd::Identity(size/2, size/2);
00021 mat1.bottomRightCorner(size/2, size/2) = MatrixXd::Zero(size/2, size/2);
00022 std::cout << mat1 << std::endl << std::endl;
00023 
00024 MatrixXd mat2(size, size);
00025 mat2.topLeftCorner(size/2, size/2).setZero();
00026 mat2.topRightCorner(size/2, size/2).setIdentity();
00027 mat2.bottomLeftCorner(size/2, size/2).setIdentity();
00028 mat2.bottomRightCorner(size/2, size/2).setZero();
00029 std::cout << mat2 << std::endl << std::endl;
00030 
00031 MatrixXd mat3(size, size);
00032 mat3 << MatrixXd::Zero(size/2, size/2), MatrixXd::Identity(size/2, size/2),
00033         MatrixXd::Identity(size/2, size/2), MatrixXd::Zero(size/2, size/2);
00034 std::cout << mat3 << std::endl;
00035 
00036 
00037   return 0;
00038 }


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