function T=Given(A)
[n, n] = size(A); 
for i=1:n
for j=i+2:n
t = -atan(A(i, j)/A(i, i + 1));
c = cos(t); s = sin(t);
for ii=1:n 
for jj=1:n
Q(ii, jj) = 0.0; 
if (ii == jj) Q(ii, jj) = 1.0; 
end; 
end;
end

Q(i+1, i+1) = c;
Q(i+1, j) = s;
Q(j, i+1) = -s;
Q(j, j) = c;
for i1=1:n 

for j1=1:n
QT(i1, j1) = Q(j1, i1); 
end; 

end
for i2=1:n 

for j2=1:n s=0;
for k=1:n 

ss = QT(i2, k) * A(k, j2);
s = s + ss; 

end; 
QTA(i2, j2) = s; 
end; 

end

for i3=1:n 
for j3=1:n s=0; 
for k=1:n
ss = QTA(i3, k) * Q(k, j3); 
s = s + ss; 
end
A(i3, j3) = s;
end; 
end; 

end; 
end
T=A;
end

