function x = forwardsubst(L,b)
% Solution of lower triangular linear system of equations 
% by means of forward substitution
[n,m] = size(L); x = zeros(n,1);
for i=1:n
  for j=1:i-1, x(i) = x(i) + L(i,j)*x(j); end
  x(i) = (b(i) - x(i))/L(i,i);
end
