%*************************************************************************
% Complete Factorization Method
% No pivoting
%*************************************************************************

function [L,U] = LUfact_full(A)
 
N=size(A,1); 
L=zeros(N,N);
for i=1:N 
  L(i,i)=1;
end

U=A;

for r = 1:N-1
    for i=r+1:N  % -> current row
        L(i,r) =  U(i,r)/U(r,r);
%        for j=r+1:N % -> current column
            U(i,r+1:N) = U(i,r+1:N) - L(i,r)*U(r,r+1:N);
%        end
    end
end

U=triu(U); 


