function r8ccs_ijk_test ( )

%*****************************************************************************80
%
%% r8ccs_ijk_test tests r8ccs_ijk.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 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_ijk_test\n' );
  fprintf ( 1, '  r8ccs_ijk gets K from (I,J) for 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_ijk locates some (I,J) entries.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '         I         J         K\n' );
  fprintf ( 1, '\n' );

  for ( test = 1 : test_num )
    i = randi ( [ 1, m ], 1 );
    j = randi ( [ 1, n ], 1 );
    k = r8ccs_ijk ( m, n, nz_num, colptr, rowind, i, j );
    fprintf ( 1, '  %8d  %8d  %8d\n', i, j, k );
  end

  return
end
