  function [G] = ColChol (A) 
% function [G] = ColChol (A) 
% Column Cholesky factorization of A
% returns a low. triang. matrix.
%
 n = size(A,1) ;
 for j=1:n
%%-------------------- perform updates
   for k=1:j-1
     A(j:n,j)=A(j:n,j)-A(j:n,k)*A(j,k); 
   end
%%-------------------- get diag. entry
   A(j,j) = sqrt(A(j,j));
%%-------------------- scale to get column
   A(j+1:n,j) = A(j+1:n,j)/A(j,j);
 end  
 G = tril(A); 
