solve a matrix and cache the result