function [ZAR ] = ZArrowR(ZT,RT,n,j);

% call: [ZAR ] = ZArrowR(ZT,RT,n,j);
% calculate  ZAR = VT*inv(Z)*VTt*Arrow(e_j)*VT*R*VTt 
% 15.01.2002, rsotirov, klagenfurt  
  
if j == 1,
  ZAR = ZT(:,1)*RT(1,:);
else
  ZAR = ZT(:,j)*RT(j,:) - (ZT(:,1)*RT(j,:) + ZT(:,j)*RT(1,:))/2;
end;


% za testiranje:
% ZT=rand(n*n+1); ZT=ZT+ZT';
% RT=rand(n*n+1); RT=RT+RT';
% j=1;
% ej = zeros(n*n+1,1); ej(j)=1;
% pom = 2:n*n+1;
% Arrow = [ej(1,1), - ej(pom,1)'/2; - ej(pom,1)/2, diag(ej(pom,1))];
% zar = ZT*Arrow*RT;
% norm(zar - ZAR)

