To avoid overfitting and improve efficiency, in practice we restrict the distance metrics M h to be diagonal (Xing et al., 2002).
the PSD project of M h (line 17) is simply taking the positive part for each diagonal elements.