Spectral Criterion for Definiteness