function r8st_transpose_test ( )

%*****************************************************************************80
%
%% r8st_transpose_test() tests r8st_transpose().
%
%  Discussion:
%
%    The matrix is:
%
%      11  12   0   0  15
%      21  22   0   0   0
%       0   0  33   0  35
%       0   0   0  44   0
%      51   0  53   0  55
%
%    The index vectors are 1 based, and so have to be converted to
%    0-base before being written.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    27 September 2018
%
%  Author:
%
%    John Burkardt
%
  m = 5;
  n = 5;
  nst = 11;
  ast = [ 51.0; 12.0; 11.0; 33.0; 15.0; 53.0; 55.0; 22.0; 35.0; 44.0; 21.0 ];
  ist = [ 5; 1; 1; 3; 1; 5; 5; 2; 3; 4; 2 ];
  jst = [ 1; 2; 1; 3; 5; 3; 5; 2; 5; 4; 1 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8st_transpose_test():\n' );
  fprintf ( 1, '  r8st_transpose() transposes an R8ST file.\n' );

  ist(1:nst) = ist(1:nst) - 1;
  jst(1:nst) = jst(1:nst) - 1;

  i_min = min ( ist );
  i_max = max ( ist );
  j_min = min ( jst );
  j_max = max ( jst );

  r8st_header_print ( i_min, i_max, j_min, j_max, m, n, nst );

  r8st_print ( m, n, nst, ist, jst, ast, '  Sparse Triplet data:' );

  [ mt, nt, nstt, istt, jstt, astt ] = r8st_transpose ( m, n, nst, ist, ...
    jst, ast );

  r8st_print ( mt, nt, nstt, istt, jstt, astt, '  Transpose matrix:' );

  return
end

