% function new_location=set_loc(gx1, gy1, gx2, gy2, max_row_idx, X, gidTable)

function new_location = set_loc(gx1, gy1, gx2, gy2, max_row_idx, X)

gid1 = (gy1 + (gx1-1)*max_row_idx ) ;
gid2 = (gy2 + (gx2-1)*max_row_idx ) ;

% gid1=(gx1 + (gy1-1)*max_row_idx );
% gid2=(gx2 + (gy2-1)*max_row_idx );
% 
% [m,n]=size(gidTable);
% 
% for i=1:m
%     if( gidTable(i,2)==gid1 )
%         g1=gidTable(i,1);
%     end
%     if( gidTable(i,2)==gid2 )
%         g2=gidTable(i,1);
%     end
% end

X(gid1,gid2)=-1;
X(gid2,gid1)=-1;

new_location=X;
