ghostridergr
Member level 1
Hello, i need your help.
The probelm is this: i have lets say 2 matrixes with data, the first one to have N rows and the second one M rows. what i want is for every row of the first matrix apply a function for every row of the second, then move on the next row of the first matrix and apply the function to all the rows of the second and so on. The problem is if i do it in that way it's not quite effective cause i end up reading same values more then one (i read each row of the second matrix N times) , Can anyone suggest me how can o do it faster and effective in what i use (memory, hardware whatever)?
the equivalent pseudo-code in C will look like this:
for (i=1;i<N, i++)
for (j=1<j<M;j++)
f(i,j) //where the arguments are whole rows
end
end
The probelm is this: i have lets say 2 matrixes with data, the first one to have N rows and the second one M rows. what i want is for every row of the first matrix apply a function for every row of the second, then move on the next row of the first matrix and apply the function to all the rows of the second and so on. The problem is if i do it in that way it's not quite effective cause i end up reading same values more then one (i read each row of the second matrix N times) , Can anyone suggest me how can o do it faster and effective in what i use (memory, hardware whatever)?
the equivalent pseudo-code in C will look like this:
for (i=1;i<N, i++)
for (j=1<j<M;j++)
f(i,j) //where the arguments are whole rows
end
end