python - scipy LU factorization permutation matrix -


as understand lu factorization, means matrix can written = lu lower-triangular matrix l , upper-triangular matrix u.

however, functions in scipy relating lu factorizations (lu, lu_factor, lu_solve) seem involve third matrix p, such = plu , p permutation matrix (and l, u before).

what point of permutation matrix? if "true" lu factorization possible, why ever have p other identity matrix?

consider gaussian elimination process. do if there's 0 on pivot? have switch rows, introduces p matrix.

moreso, small non-zero pivot values lead numerical instability in floating point environment. basic algorithms avoid searching entry largest absolute value in pivot column , switching corresponding row pivot row.

this switch can expensive, largest absolute value entry have bigger pivot's absolute value factor, e.g. 10, switch occur. reduces number of switches, keeps necessary limit floating point errors.

search "lu factorization partial pivoting" number of resources on issue.

note: since p permutation matrix, p^t = p^(-1). thus, ax = b has same solution lux = p^t b (some implementations return you've called p, while others return you'd call p^t , call p - make sure know 1 is. it's difference betwee 'pa = lu', , 'a = plu' - p's not same in each case).


Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -