function ccs_write ( prefix, ncc, n, icc, ccc, acc )

%*****************************************************************************80
%
%% ccs_write() writes a sparse matrix in CCS format to 3 files.
%
%  Discussion:
%
%    Three files will be created:
%    * prefix_icc.txt contains NCC ICC values;
%    * prefix_ccc.txt contains N+1 CCC values;
%    * prefix_acc.txt contains NCC ACC values.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 June 2022
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    string PREFIX, a common prefix for the filenames.
%
%    integer NCC, the number of elements.
%
%    integer N, the number of columns in the matrix.
%
%    integer ICC(NCC), the rows.
%
%    integer CCC(N+1), the compressed columns.
%
%    real ACC(NCC), the values.
%
  filename_icc = strcat ( prefix, '_icc.txt' );
  save ( filename_icc, 'icc', '-ascii' );
  fprintf ( 1, '  Saved data as "%s"\n', filename_icc );

  filename_ccc = strcat ( prefix, '_ccc.txt' );
  save ( filename_ccc, 'ccc', '-ascii' );
  fprintf ( 1, '  Saved data as "%s"\n', filename_ccc );

  filename_acc = strcat ( prefix, '_acc.txt' );
  save ( filename_acc, 'acc', '-ascii' );
  fprintf ( 1, '  Saved data as "%s"\n', filename_acc );

  return
end
