Artificial intelligent assistant

How can I find partial pivoting matrix $P$ from $PA=LU$ decomposition if we know $A,L,U$? Assume that we have this equation $$PA=LU$$ Where $A \in \Re^{mxn}$, $L \in \Re^{mxn}$ is a lower triangular matrix and $U \in \Re^{nxn}$ is an upper triangular matrix. $P \in \Re^{mxm}$ is the partial pivoting matrix. In this case, $A,U,L$ are known. How can I find $P$? Can I take $$P = LUA^{\dagger}$$ ?

Yes, this is correct.

Your problem seems to be that LAPACK doesn't return the pivoting matrix, but a permutation vector. This thread might help:

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy d3a9036dd5bb85c5a7f5e421934a5e44