I need to permute a vector according to an index array jpvt returned by ?geqp3. In the example lapack/source/dgeqpfx.f it is done using an auxiliary array. I would like to do the transformation inplace (or at least with O(1) extra memory), but as you can see from the attached source code, I don’t seem to be able to use ?laswp correctly. Can this be used for this kind of transformation ? If yes, how ? If no, is there another way to do this ?
Thank you in advance.
Hi qweasd q.
The ?laswp swaps the row in a cascading way. So it can't do the permutation directly. you may use Array notation like A[:]=A[iptv[:]] in Intel Compiler https://software.intel.com/en-us/blogs/2010/09/03/simd-parallelism-using-array-notation
Hello qweasd q.
I really benefited from the function ?lapmt you mentioned above. But now I'm confused with another problem.
I need to permute the 8 bits in a byte in the order specified in parameter pmt.
I wonder if there is a similar function as ?lampt, while permutation is carried out in bits . And inupt char output char would be better. Bits arranged in vector is also OK.
Thanks for you attention.