Adds matrix inverse solving/caching functions