Change lu to return permutation vector instead of permutation matrix.

The permutation matrix can be expensive to construct. This is also in line with svd returning the singular values in a vector. Finally, this change makes lu work for sparse matrices.