Hi Matthias,
I can't be sure of the real reasons for that, but my take is that:
- the methods you are referring to are not meaningful at the level of the common base class for DiagonalMatrix and Matrix (i.e. EigenBase), so they are not implemented there and DiagonalMatrix does not inherit them
- there are easy workarounds to achieve the same goal, that are usually as efficient as a special implementation would be.
In your case, you can achieve what you want with:
DiagonalMatrix<double, Dynamic> M(10);
M.diagonal().setOnes();
std::cout << M.toDenseMatrix() << std::endl;
Idem for
M.diagonal().setRandom()
Best regards,
Adrien