On Tue, Jun 7, 2022 at 9:42 AM Sven Schreiber <svetosch(a)gmx.net> wrote:
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>
wanted = imaxr(PT)' # = imaxc(P)
Allin