get_nearest_psd_matrix function

Approximates a symmetric, real matrix by the nearest positive semidefinite matrix.