function b = ccs_mv ( m, n, ncc, icc, ccc, acc, x )

%*****************************************************************************80
%
%% ccs_mv() multiplies a CCS matrix by a vector
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    14 July 2014
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Iain Duff, Roger Grimes, John Lewis,
%    User's Guide for the Harwell-Boeing Sparse Matrix Collection,
%    October 1992
%
%  Input:
%
%    integer M, the number of rows.
%
%    integer N, the number of columns.
%
%    integer NCC, the number of values.
%
%    integer ICC(NCC), the rows.
%
%    integer CCC(N+1), the compressed columns
%
%    real ACC(NCC), the values.
%
%    real X(N), the vector to be multiplied.
%
%  Output:
%
%    real B(M), the product A*X.
%
  b = zeros(m,1);

  for j = 1 : n
    for k = ccc(j) : ccc(j+1) - 1
      i = icc(k);
      b(i) = b(i) + acc(k) * x(j);
    end
  end

  return
end
