function A = genspdm_sparse(n, dens)
%GENSPDM_SPARSE Generate a sparse n x n symmetric, positive definite matrix

  A = sprandsym(n, dens); % generate a symmetric random sparse n x n matrix

  % |A(i,j)| < 1 by construction, thus A + 2*dens*n*I is a symmetric diagonally 
  % dominant matrix; it is also symmetric positive definite
  A = A + 2*dens*n*speye(n);
end
