Matrix inversion on CPU