function st_to_crs_test01 ( )

%*****************************************************************************80
%
%% st_to_crs_test01() tests st_to_crs() using a tiny matrix.
%
%  Discussion:
%
%    This test uses a trivial matrix whose full representation is:
%
%          2  3  0  0  0
%          3  0  4  0  6
%      A = 0 -1 -3  2  0
%          0  0  1  0  0
%          0  4  2  0  1
%
%    A (1-based) ST representation, reading in order by rows is:
%
%      I  J   A
%     -- --  --
%      1  1   2
%      1  2   3
%
%      2  1   3
%      2  3   4
%      2  5   6
%
%      3  2  -1
%      3  3  -3
%      3  4   2
%
%      4  3   1
%
%      5  2   4
%      5  3   2
%      5  5   1
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 July 2014
%
%  Author:
%
%    John Burkardt
%
  nst = 12;

  ast = [ ...
   -1.0, -3.0,  2.0, ...
    3.0,  4.0,  6.0, ...
    1.0, ...
    2.0,  3.0, ...
    4.0,  2.0,  1.0 ];
  ist = [ ...
    3, 3, 3, ...
    2, 2, 2, ...
    4, ...
    1, 1, ...
    5, 5, 5 ];
  jst = [ ...
    2, 3, 4, ...
    1, 3, 5, ...
    3, ...
    1, 2, ...
    2, 3, 5 ];
  m = 5;
  n = 5;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'st_to_crs_test01():\n' );
  fprintf ( 1, '  Convert a sparse matrix from ST to crs format.\n' );
  fprintf ( 1, '  ST:  sparse triplet,    I,  J, A.\n' );
  fprintf ( 1, '  crs: compressed row   , RR, J, A.\n' );
%
%  Print the ST matrix.
%
  title = 'The ST matrix:';
  st_print ( m, n, nst, ist, jst, ast, title );
%
%  Convert from ST to CRS format.
%
  [ nz, m, n, row, col, val ] = st_to_crs ( nst, ist, jst, ast );
%
%  Print the crs matrix.
%
  title = 'The crs matrix:';
  crs_print ( m, n, nz, row, col, val, title );

  return
end
