function error_frobenius = r8mat_is_lu ( m, n, a, l, u )

%*****************************************************************************80
%
%% r8mat_is_lu() measures the error in an LU factorization.
%
%  Discussion:
%
%    An R8MAT is a matrix of real values.
%
%    This routine simply returns the Frobenius norm of the M x N matrix:
%    A - L * U.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    27 October 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, N, the order of the matrix.
%
%    real A(M,N), the matrix.
%
%    real L(M,M), U(M,N), the LU factors.
%
%  Output:
%
%    real ERROR_FROBENIUS, the Frobenius norm of A - L * U.
%
  d(1:m,1:n) = a(1:m,1:n) - l(1:m,1:m) * u(1:m,1:n);

  error_frobenius = norm ( d, 'fro' );

  return
end
