Fix bug in linalg.diag
Merge pull request #70 from untom/fix_diag

Fix type bug and use CUBLAS in linalg.diag().