function change_diophantine_test01 ( )

%*****************************************************************************80
%
%% change_diophantine_test01() tests change_diophantine().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    18 October 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'change_diophantine_test01():\n' );
  fprintf ( 1, '  change_diophantine() solves a change-making problem.\n' );

  test_num = 7;

  for test = 1 : test_num

    if ( test == 1 )
      value = [  5,  9, 13 ];
      target = 19;
    elseif ( test == 2 )
      value = [  1,  4,  5,  8, 11 ];
      target = 29;
    elseif ( test == 3 )
      value = [  1,  5, 10, 25, 50, 100 ];
      target = 96;
    elseif ( test == 4 )
      value = [  1,  2,  6, 12, 24,  48,  60 ];
      target = 96;
    elseif ( test == 5 )
      value = [  1,  3,  4 ];
      target = 6;
    elseif ( test == 6 )
      value = [ 16, 17, 23, 24, 39,  40 ];
      target = 100;
    elseif ( test == 7 )
      value = [  6,  9, 20 ];
      target = 43;
    end

    fprintf ( 1, '\n' );
    fprintf ( 1, '  Test %d:\n', test );

    if ( diophantine_nd_check ( value, target ) )

      diophantine_equation_print ( value, target );
  
      x = diophantine_nd_nonnegative ( value, target );

      x_num = size ( x, 1 );
      fprintf ( 1, '    %d solutions found\n', x_num );
      fprintf ( 1, '    %d coins in minimal solution.\n', min ( sum ( x' ) ) );

      if ( x_num <= 50 )
        diophantine_solution_print ( value, target, x );
      else
        fprintf ( 1, '    Too many solutions to print.\n' );
      end

    else
      fprintf ( '  Test rejected.\n' );
    end

  end

  return
end

