Implement functions to get diagonal entries and scale rows and columns

Added methods for:
* Getting the diagonal elements
* Scaling rows
* Scaling columns

#### TODO
- [x] Merge #270 first
- [x] add more tests for constructing sparse matrix
- [x] overload equality check for CSRmatrices
I would create `is_a` for MatrixBase instances, and put it into `matrix.h`. Just copy the implementation of `is_a` from `basic.h`. Then use it here. Don't use the raw `typeid` things.

Then, use `static_cast`, because you know that it can be cast.