added functions to get implicit matrix diagonal locations