function y = r8crs_mtv ( n, nz, row, col, val, x )

%*****************************************************************************80
%
%% r8crs_mtv() multiplies an R8CRS matrix, transposed, times a vector.
%
%  Discussion:
%
%    The R8SR storage format stores the diagonal of a sparse matrix in DIAG.
%    The off-diagonal entries of row I are stored in entries ROW(I)
%    through ROW(I+1)-1 of OFF.  COL(J) records the column index
%    of the entry in A(J).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N: the order of the matrix.
%
%    integer NZ: the number of nonzero elements.
%
%    integer ROW(N+1): the nonzero offdiagonal elements 
%    of row I of A are contained in A(ROW(I)) through A(ROW(I+1)-1).
%
%    integer COL(NZ): the column indices of the nonzero elements of A.
%
%    real VAL(NZ): the nonzero elements of A.
%
%    real X(N): the vector to be multiplied by A.
%
%  Output:
%
%    real Y(N): the product A' * X.
%  
  y = zeros ( n, 1 );

  for i = 1 : n
    for k = row(i) : row(i+1)-1
      j = col(k);
      y(j) = y(j) + val(k) * x(i);
    end
  end

  return
end
