Implement cache solve of matrix