This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to use permutation matrix?

Tags: None
(comma "," separated)
buraker
Registered Member
Posts
1
Karma
0

How to use permutation matrix?

Thu Aug 02, 2012 11:37 am
I have a Eigen::VectorXi and I want to multiply it by a Permutation matrix and assign it again into same vector like the code below,but i am having difficulties,

Eigen::VectorXi independentIndexes,v;
for (Math::mech_uint iter=0;iter<coorcnt;iter++)
v(iter)=iter;

mech_Matrix cq=system->getConstraintJacMatrix();
v=v*cq.fullPivLu().permutationQ(); //here is the problem
independentIndexes=v.block(constcnt,0,dof,1);

How to product permutation matrix with a vector without a problem?

Thanks in advance.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: How to use permutation matrix?

Sun Aug 05, 2012 8:06 am
A PermutationMatrix as to be understood as a NxN matrix, so writing v * P where v is a Nx1 column vector and P a NxN permutation is not correct. You have to write:

v.transpose() = v.transpose() * cq.fullPivLu().permutationQ();


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]