function diophantine_nd_nonnegative_bounded_test ( )

%*****************************************************************************80
%
%% diophantine_nd_nonnegative_bounded_test() tests diophantine_nd_nonnegative_bounded().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 July 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'diophantine_nd_nonnegative_test():\n' );
  fprintf ( 1, '  diophantine_nd_nonnegative_bounded() returns solutions\n' );
  fprintf ( 1, '  of a Diophantine equation in N variables which are\n' );
  fprintf ( 1, '  nonnegative, and bounded by x(i) <= m(i).\n' );

  a = [ 2; 3 ];
  b = 18;
  m = [ 10; 10 ];
  fprintf ( 1, '\n' );
  if ( diophantine_nd_check ( a, b ) )
    diophantine_equation_print ( a, b );
    diophantine_bounds_print ( [ 0; 0 ], m );
    x = diophantine_nd_nonnegative_bounded ( a, b, m );
    diophantine_solution_print ( a, b, x );
  end

  a = [ 2; 3 ];
  b = 18;
  m = [ 5; 4 ];
  fprintf ( 1, '\n' );
  if ( diophantine_nd_check ( a, b ) )
    diophantine_equation_print ( a, b );
    diophantine_bounds_print ( [ 0; 0 ], m );
    x = diophantine_nd_nonnegative_bounded ( a, b, m );
    diophantine_solution_print ( a, b, x );
  end

  a = [ 2; 3 ];
  b = 18;
  m = [ 1; 1 ];
  fprintf ( 1, '\n' );
  if ( diophantine_nd_check ( a, b ) )
    diophantine_equation_print ( a, b );
    diophantine_bounds_print ( [ 0; 0 ], m );
    x = diophantine_nd_nonnegative_bounded ( a, b, m );
    diophantine_solution_print ( a, b, x );
  end


  a = [ 2; 3; 5; 6 ];
  b = 24;
  m = [ 6; 6; 3; 3 ];
  fprintf ( 1, '\n' );
  if ( diophantine_nd_check ( a, b ) )
    diophantine_equation_print ( a, b );
    diophantine_bounds_print ( [ 0; 0; 0; 0 ], m );
    x = diophantine_nd_nonnegative_bounded ( a, b, m );
    diophantine_solution_print ( a, b, x );
  end

  a = [ 2; 3; 5; 6; 7 ];
  b = 35;
  m = [ 6; 2; 2; 2; 2 ];
  fprintf ( 1, '\n' );
  if ( diophantine_nd_check ( a, b ) )
    diophantine_equation_print ( a, b );
    diophantine_bounds_print ( [ 0; 0; 0; 0; 0 ], m );
    x = diophantine_nd_nonnegative_bounded ( a, b, m );
    diophantine_solution_print ( a, b, x );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'diophantine_nd_nonnegative_bounded_test\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

