  function [g,h] = CholTrid(d,e)
%
% Pre:
%    d,e    n-vectors with the property that the tridiagonal matrix
%           A = diag(d) + diag(e(2:n),-1) + diag(e(2:n),1) is positive
%           definite.
% 
% Post:
%    g,h    n-vectors with the property that the lower bidiagonal
%           matrix G = diag(g) + diag(h(2:n),-1) satisfies A = GG^T.
%
            n = length(d);
			g = zeros(n,1);
			h = zeros(n,1);
			g(1) = sqrt(d(1));
			for i=2:n
			    h(i) = e(i)/g(i-1);
		        g(i) = sqrt(d(i) - h(i)^2);
			end;
