Implementation of transpose and inverse matrix functions.