Permute N-D array : why is it faster with real than complex ?
Afficher commentaires plus anciens
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....
Réponse acceptée
Plus de réponses (1)
Richard
le 23 Juin 2014
0 votes
Catégories
En savoir plus sur Shifting and Sorting Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!