function b = r8po_mv ( n, a, x )

%*****************************************************************************80
%
%% r8po_mv() multiplies a R8PO matrix times a vector.
%
%  Discussion:
%
%    The R8PO storage format is appropriate for a symmetric positive definite 
%    matrix and its inverse.  (The Cholesky factor of a R8PO matrix is an
%    upper triangular matrix, so it will be in R8GE storage format.)
%
%    Only the diagonal and upper triangle of the square array are used.
%    This same storage scheme is used when the matrix is factored by
%    R8PO_FA, or inverted by R8PO_INVERSE.  For clarity, the lower triangle
%    is set to zero.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 February 2004
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the order of the matrix.
%
%    real A(N,N), the R8PO matrix.
%
%    real X(N), the vector to be multiplied by A.
%
%  Output:
%
%    real B(N), the product A * x.
%
  b = zeros ( n, 1 );

  for i = 1 : n
    b(i) = 0.0;
    for j = 1 : i-1
      b(i) = b(i) + a(j,i) * x(j);
    end
    for j = i : n
      b(i) = b(i) + a(i,j) * x(j);
    end
  end

  return
end
