Adding algorithm for caching of sparsity patterns (not enabled), #575