function [l,u] = TriDiUL(d,e,f)
%
% Pre:
%   d,e,f   n-vectors that define a tridiagonal matrix 
%           A = diag(e(2:n),-1) + diag(d) + diag(f(1:n-1),1).
%           A has an UL factorization: A = UL with
%           L =  diag(l)+ diag(e(2:n),-1)
%           U = eye + diag(u(1:n-1),1)
% Post: 
%    l      n-vector with the property that 
%    u      n-vector with the property that 

n = length(d); 
l = zeros(n,1); 
u = zeros(n-1,1);

l(n) = d(n);
for i=n-1:-1:1
    u(i) = f(i)/l(i+1);
    l(i) = d(i) - u(i)*e(i+1);
end
