Created matrix inverse caching functions.