Fixed build problems on MacOS.

Problem 1: Host scalars weren't casted correctly when setting all entries or the diagonal of a dense matrix.
Problem 2: std::abs() is not available for unsigned integers on MacOS, hence had to adjust one test.
Moreover, uBLAS is facing the same issue, hence the tests required
to circumvent norm_1(), norm_inf(), and index_norm_inf() from uBLAS.