What did I do wrong with LAPACK.potri!?

Turns out that I need to call potrf before potri.

The documentation

Computes the inverse of positive-definite matrix A after calling potrf! to find its (upper if uplo = U , lower if uplo = L ) Cholesky decomposition.

made me think that potri would call potrf internally. But that is not the case.

So

LinearAlgebra.LAPACK.potrf!('U', V)
LinearAlgebra.LAPACK.potri!('U', V)
LinearAlgebra.copytri!(V, 'U')
V * Vcopy

would give back identity.

2 Likes