function A = ddrandom(n)
% DDRANDOM - diagonally dominant random matrix
    A = rand(n, n);
    A = A + diag(sum(abs(A),2).*sign(diag(A)));  % ensure diagonal dominance
end
