Convert a permutation vector into matrix.
P = spilu_permVecToMat(perm)
a 1-by-n full matrix of doubles, integer value, positive, the permutation vector. Each entry perm(i) should be in the set {1,2,...,n}.
a n-by-n sparse matrix of doubles, the permutation matrix
Convert a permutation vector into a sparse permutation matrix.
perm = [5,2,3,4,1,6] P = spilu_permVecToMat(perm); full(P) Pexpected = [ 0. 0. 0. 0. 1. 0. 0. 1. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 1. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. ]; | ![]() | ![]() |