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 fixed this. Thanks.