function error_frobenius = r8mat_is_antisymmetric ( m, n, a )

%*****************************************************************************80
%
%% r8mat_is_antisymmetric() checks an R8MAT for antisymmetry.
%
%  Discussion:
%
%    An R8MAT is a matrix of real ( kind = 8 ) values.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 April 2017
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, N, the row and column dimensions of 
%    the matrix.  M and N must be positive.
%
%    real A(M,N), the matrix.
%
%  Output:
%
%    real ERROR_FROBENIUS, the Frobenius error in
%    antisymmetry, which would be 0 if the matrix is exactly antisymmetric.
%
  if ( ~ r8mat_is_square ( m, n, a ) )
    error_frobenius = Inf;
    return
  end

  error_frobenius = 0.0;

  for i = 1 : m
    for j = 1 : i - 1
      error_frobenius = error_frobenius + ( a(i,j) + a(j,i) ) ^ 2;
    end
    error_frobenius = error_frobenius + a(i,i) ^ 2;
  end

  error_frobenius = sqrt ( error_frobenius );

  return
end
