function t=inv_triu(t)
% inv_triu - Inverse of upper triangular matrix
% 
% inv_triu :: [[N,N]] -> [[N,N]].

n=size(t,1);
for k=1:n
	if t(k,k)~=0
		t(k,k) = 1/t(k,k);
		t(1:k-1,k) = -t(1:k-1,k) * t(k,k);

		j = k+1:n;
		temp = t(k,j);
		t(k,j) = 0;
		t(1:k,j) = t(1:k,j) + t(1:k,k)*temp;
	end
end


