matrix inversion with low complexity