Implement linalg.dot_diag using dgmm

As discussed in #25 , this implements `linalg.dot_diag` using *dgmm. This brings some speedups. 

**IMPORTANT:** this PR breaks `linalg.pinv` for complex arguments, as that function relied upon the possibility to multiply a diagonal and a dense matrix of different types. I don't understand the `pinv` implementation enough to fix that, so I didn't!