Permute N-D array : why is it faster with real than complex ?
Show older comments
Hi!
I'm encoding a matlab function which calculate the contraction of two tensor. It's quite good but I have a problem with permute : it's faster with real than complex. For example :
>> A=rand(250,10,500,120);
>> B=complex(rand(250,10,500,120),rand(250,10,500,120));
>> sigma=[3 4 1 2];
>> tic; A=permute(A,sigma); toc
Elapsed time is 0.945218 seconds.
>> tic; B=permute(B,sigma); toc
Elapsed time is 3.444950 seconds.
Do you know why is there such a gap ? Can you help me reduce it ?
Thanks!
PS : I'm sorry, my English is not good....
Accepted Answer
More Answers (1)
Richard
on 23 Jun 2014
0 votes
Categories
Find more on Shifting and Sorting Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!