I have read Numerically find the nearest positive semi definite matrix to a symmetric matrix and How to find the nearest/a near positive definite from a given matrix?
But the key problem is I need to do this fast. I have a 10K by 10K dense matrix, and finding all the eigenvalues are slow... But usually I know the matrix is only slightly non-PSD. i.e. the negative eigenvalues are small in magnitude and there are also not that many of them.
What's the most numerically efficient method? I am using python, if there is an existing solution that'd be helpful