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:
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: