function crs_write_test ( )

%*****************************************************************************80
%
%% crs_write_test() tests crs_write() 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
%
%    The 1-based CRS representation is
%
%      #  ROW  COL  VAL
%     --  ---  ---  ---
%      1    1    1    2
%      2         2    3
%
%      3    3    1    3
%      4         3    4
%      5         5    6
%
%      6    6    2   -1
%      7         3   -3
%      8         4    2
%
%      9    9    3    1
% 
%     10   10    2    4
%     11         3    2
%     12         5    1
%
%     13   13    *
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 June 2022
%
%  Author:
%
%    John Burkardt
%
  n = 5;
  nz = 12;

  row = [ ...
    1, 3, 6, 9, 10, 13 ];
  col = [ ...
    1, 2, ...
    1, 3, 5, ...
    2, 3, 4, ...
    3, ...
    2, 3, 5 ];
  val = [ ...
    2.0,  3.0, ...
    3.0,  4.0,  6.0, ...
   -1.0, -3.0,  2.0, ...
    1.0, ...
    4.0,  2.0,  1.0 ];

  prefix = 'simple';

  fprintf ( 1, '\n' );
  fprintf ( 1, 'crs_write_test():\n' );
  fprintf ( 1, '  Write a sparse matrix in crs format to 3 files.\n' );
%
%  Print the matrix.
%
  crs_print ( n, nz, row, col, val, '  The matrix in crs format:' );
%
%  Write the matrix to 3 files.
%
  crs_write ( prefix, row, col, val );

  return
end
