function st_to_ccs_test03 ( )

%*****************************************************************************80
%
%% st_to_ccs_test03() creates a CCS sparse matrix file from an ST file.
%
%  Discussion:
%
%    We assume no prior knowledge about the matrix except the filename.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 July 2014
%
%  Author:
%
%    John Burkardt
%
  filename_st = 'west_st.txt';
  filename_acc = 'west_acc.txt';
  filename_ccc = 'west_ccc.txt';
  filename_icc = 'west_icc.txt';

  fprintf ( 1, '\n' );
  fprintf ( 1, 'st_to_ccs_test03\n' );
  fprintf ( 1, '  Convert a sparse matrix from ST to CCS format.\n' );
  fprintf ( 1, '  ST:  sparse triplet,    I, J,  A.\n' );
  fprintf ( 1, '  CCS: compressed column, I, CC, A.\n' );
  fprintf ( 1, '  The ST matrix is read from the file "%s"\n', filename_st );
  fprintf ( 1, '  and the CCS matrix is written to the files:\n' );
  fprintf ( 1, '    "%s",\n', filename_icc );
  fprintf ( 1, '    "%s", and\n', filename_ccc );
  fprintf ( 1, '    "%s".\n', filename_acc );
%
%  Get the size of the ST matrix.
%
  [ i_min, i_max, j_min, j_max, m, n, nst ] = st_header_read ( filename_st );

  st_header_print ( i_min, i_max, j_min, j_max, m, n, nst );
%
%  Read the ST matrix.
%
  [ ist, jst, ast ] = st_data_read ( filename_st, m, n, nst );
%
%  Get the CCS size.
%
  ncc = st_to_ccs_size ( nst, ist, jst );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of CCS values = %d\n', ncc );
%
%  Create the CCS indices.
%
  [ icc, ccc ] = st_to_ccs_index ( nst, ist, jst, ncc, n );
%
%  Create the CCS values.
%
  acc = st_to_ccs_values ( nst, ist, jst, ast, ncc, n, icc, ccc );
%
%  Write the CCS matrix.
%
  i4vec_write ( filename_icc, ncc, icc );
  i4vec_write ( filename_ccc, n + 1, ccc );
  r8vec_write ( filename_acc, ncc, acc );

  return
end
