shreyas krishnan wrote: > Hi, > For this simple loop, I get the following distance and direction > vector > > Distance {1,-1) > Direction (2,0) > > for(J = 1; J <= N-1; J++) > for(I = 1; I <= N-1; I++) > { > XX = X[I+1][J]; > XY = X[I][J+1]; > } > > > Can some body explain why thats so ?
Because: at iteration J=1, I=2 you're accessing X[I][J+1], i.e. X[2][2] at iteration J=2, I=1 you're accessing X[I+1][J], i.e. X[2][2] thus, you have accessed the same array location at a distance of (1, -1) in the iteration space. Now, if you get a lexicographically negative distance vector, you should know that this is a wrong answer, and the cause for this is that the current subscript coupling does not implement the delta test. I should filter out all these cases just for ensuring that anybody gets hurt by this one: this is already what we're doing in the autovect branch. Sebastian