use vector instead of set in sparsity pattern

Set takes about three times the memory of a
vector. Therefore using a set leads to a sparsity
pattern which uses more memory than the matrix
itself.