function diophantine_test04 ( )

%*****************************************************************************80
%
%% diophantine_test04() tests diophantine on a three-variable problem.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 April 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'diophantine_test04():\n' );
  fprintf ( 1, '  Solve one Diophantine equation in three variables.\n' );

  a = [ 6; 15; 10 ];
  b = 60;
  diophantine_equation_print ( a, b );

  [ d, v, B ] = diophantine_basis ( a, b );

  diophantine_basis_print ( d, v, B );

  r = diophantine_residual ( a, b, v );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The residual for the particular solution with c=0 is %d\n', r );

  for k1 = 28 : 30
    for k2 = 40 - k1 : 12
      u = v + B * [k1;k2];
      fprintf ( 1, '(%d,%d): %d %d + %d %d + %d %d = %d\n', ...
        k1, k2, a(1), u(1), a(2), u(2), a(3), u(3), b );
    end
  end

  return
end

