optimizing hash map for matrix_transpose * transpose