Implement linalg.dot_diag using dgmm

NOTE: linalg.pinv currently broken for complex arguments.