function b = r83s_mtv ( m, n, a, x )

%*****************************************************************************80
%
%% R83S_MTV computes b=A'*x, where A is an R83S matrix.
%
%  Discussion:
%
%    The R83S storage format is used for a tridiagonal scalar matrix.
%    The vector A(3) contains the subdiagonal, diagonal, and superdiagonal
%    values that occur on every row.
%    RGE A(I,J) = R83S A(I-J+2).
%
%  Example:
%
%    Here is how an R83S matrix of order 5, stored as (A1,A2,A3), would
%    be interpreted:
%
%      A2  A1   0   0   0
%      A3  A2  A1   0   0
%       0  A3  A2  A1   0 
%       0   0  A3  A2  A1
%       0   0   0  A3  A2
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    05 September 2015
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer M, N, the order of the matrix.
%
%    Input, real A(3), the R83S matrix.
%
%    Input, real X(M), the vector to be multiplied by A'.
%
%    Output, real B(N), the product A' * x.
%
  b = zeros ( n, 1 );

  for j = 1 : n
    for i = max ( 1, j - 1 ) : min ( m, j + 1 )
      b(j) = b(j) + a(i-j+2) * x(i);
    end
  end

  return
end