Complete matrix cache functions.