function knapsack_dynamic_test ( )

%*****************************************************************************80
%
%% knapsack_dynamic_test() tests knapsack_dynamic().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 October 2022
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../knapsack_dynamic' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'knapsack_dynamic_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test knapsack_dynamic().\n' );

  for test = 1 : 6

    if ( test == 1 )
      c = 165;
      n = 10;
      p = [  92,  57,  49,  68,  60,  43,  67,  84,  87,  72 ];
      w = [  23,  31,  29,  44,  53,  38,  63,  85,  89,  82 ];
    elseif ( test == 2 )
      c = 26;
      n = 5;
      p = [  24,  13,  23,  15,  16 ];
      w = [  12,   7,  11,   8,   9 ];
    elseif ( test == 3 )
      c = 190;
      n = 6;
      p = [  50,  50,  64,  46,  50,   5 ];
      w = [  56,  59,  80,  64,  75,  17 ];
    elseif ( test == 4 )
      c = 50;
      n = 7;
      p = [  70,  20,  39,  37,   7,   5,  10 ];
      w = [  31,  10,  20,  19,   4,   3,   6 ];
    elseif ( test == 5 )
      c = 104;
      n = 8;
      p = [ 350, 400, 450,  20,  70,   8,   5,   5 ];
      w = [  25,  35,  45,   5,  25,   3,   2,   2 ];
    elseif ( test == 6 )
      c = 67;
      n = 10;
      p = [ 505, 352, 458, 220, 354, 414, 498, 545, 473, 543 ];
      w = [  23,  26,  20,  18,  32,  27,  29,  26,  30,  27 ];
    end

    knapsack_dynamic_test01 ( p, w, c );

  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'knapsack_dynamic_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );
  rmpath ( '../knapsack_dynamic' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end
