Add implementation for cached matrix solver and comments.