GTH_SOLVE: Returns the output of the same type as the input matrix