<< spilu_ilukM Support

Spilu >> Spilu > Support > spilu_permVecToMat

spilu_permVecToMat

Convert a permutation vector into matrix.

Calling Sequence

P = spilu_permVecToMat(perm)

Parameters

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}.

P :

a n-by-n sparse matrix of doubles, the permutation matrix

Description

Convert a permutation vector into a sparse permutation matrix.

Examples

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.
];

Authors


Report an issue
<< spilu_ilukM Support