function b = r8ncf_mv ( m, n, nz_num, rowcol, a, x )

%*****************************************************************************80
%
%% R8NCF_MV multiplies an R8NCF matrix by an R8VEC.
%
%  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:
%
%    20 July 2016
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer M, N, the order of the matrix.
%
%    Input, integer NZ_NUM, the number of nonzero elements in 
%    the matrix.
%
%    Input, integer ROWCOL(2,NZ_NUM), the row and column 
%    indices of the nonzero elements.
%
%    Input, real A(NZ_NUM), the nonzero elements of the matrix.
%
%    Input, real X(N), the vector to be multiplied by A.
%
%    Output, real B(M), the product A * x.
%
  b = zeros ( m, 1 );

  for k = 1 : nz_num
    i = rowcol(1,k);
    j = rowcol(2,k);
    b(i) = b(i) + a(k) * x(j);
  end

  return
end
