function [ a, seed ] = r8ncf_random ( m, n, nz_num, rowcol, seed )

%*****************************************************************************80
%
%% R8NCF_RANDOM randomizes an R8NCF matrix.
%
%  Discussion:
%
%    The R8NCF storage format stores NZ_NUM, the number of nonzeros, 
%    a real array containing the nonzero values, a 2 by NZ_NUM integer 
%    array storing the row and column of each nonzero entry.
%
%    The R8NCF format is used by NSPCG.  NSPCG requires that the information
%    for the diagonal entries of the matrix must come first.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    24 July 2016
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer M, N, the number of rows and columns in
%    the matrix.
%
%    Input, integer NZ_NUM, the number of nonzero entries.
%
%    Input, integer ROWCOL(2,NZ_NUM), the coordinates of 
%    the nonzero entries.
%
%    Input/output, integer SEED, a seed for the random 
%    number generator.
%
%    Output, real A(NZ_NUM), the indicator matrix.
%
  a = zeros ( nz_num, 1 );

  for k = 1 : nz_num
    i = rowcol(1,k);
    j = rowcol(2,k);
    [ a(k), seed ] = r8_uniform_01 ( seed );
  end

  return
end
