new subroutine invert_permutation()
new subroutine tmod_mat_invert_transpose()