cachable matrix inversion