简体   繁体   中英

LU decomposition python with vector pivot

The LU decomposition function provided by scipy returns a permutation matrix P

P,L,U = scipy.linalg.lu(A)

Where A is a rectangular matrix. However the size of my problem do not allow to store P (even temporary) due to its size, I really need a function that computes a permutation vector (like [L,U,P] = lu(A,'vector') in Matlab). I found a lapack function

LU,p,info = scipy.linalg.lapack.dgetrf(A)

which seems to return a vector p but I learned this latter is not an actual permutation vector since it contains twice the same value ( https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/780655 ). I am thus looking for another function (which may be from another library) to perform this LU decomposition with pivoting. Since the computation time is also very important, I don't think implementing the decomposition myself will be efficient.

Yes, it's a pivot vector, which is a standard LAPACK return. So you'll need to convert it into whatever other form you want yourself (and this is much easier then reimplementing the factorization).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM