Compact Computation of the Inverse of a Matrix