 function [U]  = cholR (A) 
%---------------------------------------------
% function [U] = cholR (A) 
% performs row-Cholesky factorization of A 
%---------------------------------------------
 n = size(A,1) ;
 for k=1:n 
   if (A(k,k)<=0), error(' pivot <=0 '), end
   t = sqrt(A(k,k));
   A(k,k:n) = A(k,k:n) /t;
   for i=k+1:n
     A(i,i:n)=A(i,i:n)-A(k,i)*A(k,i:n);
  end 
 end
 U = triu(A);

