function [ l, u ] = moler3_lu ( n )

%*****************************************************************************80
%
%% moler3_lu() returns the LU factors of the MOLER3 matrix.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 October 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the order of the matrix.
%
%  Output:
%
%    real L(N,N), U(N,N) the LU factors.
%
  l = zeros ( n, n );

  for i = 1 : n
    l(i,1:i-1  ) = -1.0;
    l(i,  i    ) =  1.0;
    l(i,  i+1:n) =  0.0;
  end

  u = zeros ( n, n );

  for j = 1 : n
    u(1:j-1,  j) = -1.0;
    u(  j,    j) =  1.0;
    u(  j+1:n,j) =  0.0;
  end

  return
end
