In eigen, we can create a matrix as
Matrix3f m;
m << 1, 2, 3,
4, 5, 6,
7, 8, 9;
How can I create a diagonal matrix like the one below
3, 0, 0,
0, 8, 0,
0, 0, 6;
I don't understand how Eigen handle diagonal matrix? Only the diagonal elements are important here. So does Eigen save all 9 elements from above example or Eigen just save only 3 elements 3,8,6. Also, if eigen save all 9 elements then is it necessary to define the matrix as diagonal or is it the same as defining normal 3*3 matrix?