%  test1

V = [ eye( n-1 ); - ones( n-1,1)'];         
e = ones(n,1);
VT = [1, zeros(1,(n-1)*(n-1));kron(e,e)/n, kron(V,V) ];   %clanak
VT = sparse(VT);



ZT = VT*VT'; %ZT = VT*eye((n-1)^2+1)*VT';
%RT = VT*VT'; %RT = VT*eye((n-1)^2+1)*VT'; 
ZT = eye(n^2+1);
RT=ZT;


eq=length(P);
rez = [];
for j = 1:eq,
     ej=zeros(eq,1); ej(j)=1;
     [GTt] = GT(ej,P,Q,eq,n); 
%    GTt = zeros(n*n+1);
%    GTt(P(j),Q(j)) = 1;
     GTt = ( GTt + GTt' )/2;

     pom = ZT*GTt*RT; 

    [Gpom] = G(pom,P,Q,eq,n);
    rez = [rez,Gpom];
end;


[R22] = M22(ZT,RT,P,Q,eq,n);

norm(R22-rez)



%v = rand(length(indso),1);
%re = Mat*v;
%[GTt] = GT(v,P,Q,eq,n);