This is the rank
return value of the LAPACK pstrf
function (Cholesky with complete pivoting).
I’m not sure how reliable a rank estimate this is? LU can be an unreliable way to compute rank, even with complete pivoting (see e.g. the links in this discussion), but I’m not sure if complete-pivoted Cholesky has the same issues.
In any case, it would be good if you could simply call rank(Achol)
on the CholeskyPivoted
object to access this, similar to how one can call rank
on the pivoted QR factorization to get a QR-based rank estimate. Want to file an issue, or better yet a PR?