function part_rsf_check_test ( )

%*****************************************************************************80
%
%% part_rsf_check_test() tests part_rsf_check().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 December 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'part_rsf_check test():\n' );
  fprintf ( 1, '  part_rsf_check() checks a reverse standard form partition.\n' );
  
  for test = 1 : 6

    if ( test == 1 )
      n = 0;
      npart = 4;
      a = [ 1, 4, 4, 6 ];
    elseif ( test == 2 )
      n = 15;
      npart = 0;
      a = [ 1, 4, 4, 6 ];
    elseif ( test == 3 )
      n = 15;
      npart = 4;
      a = [ -9, 4, 4, 16 ];
    elseif ( test == 4 )
      n = 15;
      npart = 4;
      a = [ 6, 4, 4, 1 ];
    elseif ( test == 5 )
      n = 15;
      npart = 4;
      a = [ 1, 4, 5, 6 ];
    elseif ( test == 6 )
      n = 15;
      npart = 4;
      a = [ 1, 4, 4, 6 ];
    end

    fprintf ( 1, '\n' );
    fprintf ( 1, '  Partition in RSF form.\n' );
    fprintf ( 1, '  Partition of N = %d\n', n );
    fprintf ( 1, '  Number of parts NPART = %d\n', npart )
    i4vec_transpose_print ( npart, a, '' )
    check = part_rsf_check ( n, npart, a );
    fprintf ( 1, '  Check = %5s\n', mat2str ( check ) );
    
  end

  return
end
