function r8ccs_set_test ( )

%*****************************************************************************80
%
%% r8ccs_set_test tests r8ccs_set.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 October 2015
%
%  Author:
%
%    John Burkardt
%
  m = 5;
  n = 5;
  nz_num = 12;

  colptr = [ 1, 4, 6, 8, 10, 13 ];
  rowind = [ 1, 2, 4, 1, 2, 3, 5, 4, 5, 1, 2, 5 ];
  test_num = 20;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8ccs_set_test\n' );
  fprintf ( 1, '  r8ccs_set sets entries in an r8ccs matrix;\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix rows M =          %d\n', m );
  fprintf ( 1, '  Matrix columns N =       %d\n', n );
  fprintf ( 1, '  Matrix nonzeros NZ_NUM = %d\n', nz_num );

  i4vec_print ( n + 1, colptr, '  The COLPTR vector:' );

  i4vec_print ( nz_num, rowind, '  The ROWIND vector:' );

  a(1:nz_num) = 0.0;
%
%  Initialize the matrix to random values.
%
  a = r8ccs_random ( m, n, nz_num, colptr, rowind );

  r8ccs_print ( m, n, nz_num, colptr, rowind, a, ...
    '  The initial r8ccs matrix:' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  r8ccs_set sets 10 entries at random.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '         I         J         K      NEW_VALUE\n' );
  fprintf ( 1, '\n' );

  for ( test = 1 : 10 )
    k = randi ( [ 1, nz_num ], 1 );
    [ i, j ] = r8ccs_kij ( m, n, nz_num, colptr, rowind, k );
    value = 100.0 + test;
    a = r8ccs_set ( m, n, nz_num, colptr, rowind, a, i, j, value );
    fprintf ( 1, '  %8d  %8d  %8d  %14f\n', i, j, k, value );
  end

  r8ccs_print ( m, n, nz_num, colptr, rowind, a, ...
    '  The final r8ccs matrix:' );

  return
end
