add function to access diagonal indices
Merge pull request #3164 from simonbyrne/diagind

RFC: add function to access diagonal indices