Cache matrix inverse