cache matrix function added (solve) using cache vector as template