Implement cached matrix inverse functions