cache set and solve matrix in one call