Hi,

I'm wondering how I can easily construct the index vector associated
with a permutation matrix. Here's an example:

<hansl>

pvec = {3,1,2}    # given index vector

matrix P = I(nelem(pvec))[pvec,]    # associated permutation matrix

matrix PT = I(nelem(pvec))[,pvec] # transpose of that

wanted = {2,3,1} # associated with PT, how ??

</hansl>

Now, a verbose loop-based solution is quite obvious. But is there a
trick to construct the wanted index vector concisely and also for higher
dimensions, of course?

thanks

sven
_______________________________________________
Gretl-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Website: 
https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/

Reply via email to