aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/MatrixBase_part.cpp
blob: 1abbd6888367fb9ab8728fe6129fc9ca7711e969 (plain)
1
2
3
4
5
6
7
8
Matrix3d m = Matrix3i::Zero();
m.part<Eigen::StrictlyUpperTriangular>().setOnes();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "And let us now compute m*m.adjoint() in a very optimized way" << endl
     << "taking advantage of the symmetry." << endl;
Matrix3d n;
n.part<Eigen::SelfAdjoint>() = (m*m.adjoint()).lazy();
cout << "The result is:" << endl << n << endl;