function b = r8sm_mv ( m, n, a, u, v, x )

%*****************************************************************************80
%
%% R8SM_MV multiplies a R8SM matrix times a vector.
%
%  Discussion:
%
%    The R8SM storage format is used for an M by N Sherman Morrison matrix B,
%    which is defined by an M by N matrix A, an M vector U, and
%    an N vector V, by B = A - U * V'
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 August 2015
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer M, N, the number of rows and columns of the matrix.
%
%    Input, real A(M,N), the R8SM matrix.
%
%    Input, real U(M), V(N), the R8SM vectors U and V.
%
%    Input, real X(N), the vector to be multiplied by (A-u*v').
%
%    Output, real B(M), the product (A-u*v') * x.
%
  u = u(:);
  v = v(:);
  x = x(:);

  b = a * x - u * ( v' * x );

  return
end
