Inverse complements of a matrix and applications