function crs_print ( m, n, ncrs, rcrs, ccrs, Acrs, title )

%*****************************************************************************80
%
%% crs_print() prints a sparse matrix in CRS format.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 July 2014
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, the number of rows in the matrix.
%
%    integer N, the number of columns in the matrix.
%
%    integer NCC, the number of elements.
%
%    integer ICC(NCC), the rows.
%
%    integer CCC(N+1), the compressed columns.
%
%    real ACC(NCC), the values.
%
%    character ( len = * ) TITLE, a title.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '%s\n', title );
  fprintf ( 1, '     #     I     J       A\n' );
  fprintf ( 1, '  ----  ----  ----  --------------\n' );
  fprintf ( 1, '\n' );

  if ( rcrs(1) == 0 )

    i = 1;
    k = 0;
    while ( i <= m )
      for c = rcrs(i) + 1 : rcrs(i+1)
        j = ccrs(c) + 1;
        k = k + 1;
        fprintf ( 1, '  %4d  %4d  %4d  %16.8g\n', k - 1, i - 1, j - 1, Acrs(k) );
      end
      i = i + 1;
    end

  else

    i = 1;
    k = 0;
    while ( i <= m )
      for c = rcrs(i) : rcrs(i+1) - 1
        j = ccrs(c);
        k = k + 1;
        fprintf ( 1, '  %4d  %4d  %4d  %16.8g\n', k, i, j, Acrs(k) );
      end
      i = i + 1;
    end

  end

  return
end
