First version of inverse matrix caching mechanism.