Let $\mathcal{N}$ be the space of all $n \times n$ matrices that are similar to some nonnegative matrix with zero diagonal and let $f: \mathcal{N} \to \mathbb{R}$ be a continuously differentiable function. What are the lightest assumptions I can impose on $f$ to obtain that $f(M)$ it depends only on eigenvalues on $M$? Of course I can require that $f(M)$ be invariant to similarity transformations of $M$. But I would like something lighter. Ideally, I'd like to know that it suffices to assume only that $f(D M D^{-1})=f(M)$ for any *diagonal*, nonnegative matrix $D$.

Any leads?