function[L] = ChowLiskee(A)
% NOTE: A should be square.
n = length(A);

L=eye(n);
D=zeros(n);

for j = 1:1:n;
    sum=0
    for k = 1:1:(j-1);
        sum=sum+D(k,k)*L(j,k)^2;
    end;
    D(j,j)=A(j,j)-sum;
    for i = (j+1):1:n
        sum=0
        for k=1:1:(j-1);
            sum=sum+D(k,k)*L(i,k)*L(j,k);
        end;
        L(i,j) = (A(i,j)-sum)/D(j,j)
    end;
end;
D = D.^(1/2);
L = L*D;
end