Matrix inversion by augmentation and reduction