E
equinox1248
Hi,
I thought this would be answered several time in this group, but I
couldn't find anything relevant.
What would be the most efficient way of calculating sum of absolute
values of two memory blocks?
Consider A and B size of N:
int temp=0;
for (n=N;n>-1;n--)
temp+= abs(A[n]-B[n]);
How can one optimize this piece of code and make it run faster? Any
tricks are appreciated. FYI, the memory blocks carry integer values.
Thanks!
I thought this would be answered several time in this group, but I
couldn't find anything relevant.
What would be the most efficient way of calculating sum of absolute
values of two memory blocks?
Consider A and B size of N:
int temp=0;
for (n=N;n>-1;n--)
temp+= abs(A[n]-B[n]);
How can one optimize this piece of code and make it run faster? Any
tricks are appreciated. FYI, the memory blocks carry integer values.
Thanks!