function i4mat_is_ternary_test ( )

%*****************************************************************************80
%
%% i4mat_is_ternary_test tests i4mat_is_ternary.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 May 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'i4mat_is_ternary_test\n' );
  fprintf ( 1, '  i4mat_is_ternary is TRUE if an I4MAT only contains\n' );
  fprintf ( 1, '  -1, 0, and +1 entries.\n' );

  m = 2;
  n = 3;

  x = [ ...
     0, -1,  0; ... 
    +1,  0, +1 ];
  i4mat_print ( m, n, x, '  Matrix:' );
  if ( i4mat_is_ternary ( m, n, x ) )
    fprintf ( 1, '  X is ternary\n' );
  else
    fprintf ( 1, '  X is NOT ternary.\n' );
  end

  x = [ ...
    +1, +1, +1; ... 
    +1, +1, +1 ];
  i4mat_print ( m, n, x, '  Matrix:' );
  if ( i4mat_is_ternary ( m, n, x ) )
    fprintf ( 1, '  X is ternary\n' );
  else
    fprintf ( 1, '  X is NOT ternary.\n' );
  end

  x = [ ...
     0, +1,  0; ... 
    -1, +2, -1 ];
  i4mat_print ( m, n, x, '  Matrix:' );
  if ( i4mat_is_ternary ( m, n, x ) )
    fprintf ( 1, '  X is ternary\n' );
  else
    fprintf ( 1, '  X is NOT ternary.\n' );
  end

  return
end
