Added possibility to specify density as # of nonzero coefficients