function r8ss_mv_test ( )

%*****************************************************************************80
%
%% R8SS_MV_TEST tests R8SS_MV.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 March 2009
%
%  Author:
%
%    John Burkardt
%
  n = 5;
  seed = 123456789;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8SS_MV_TEST\n' );
  fprintf ( 1, '  R8SS_MV computes A*x, where A is an R8SS matrix.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix order N = %d\n', n );
%
%  Set the matrix.
%
  [ na, diag, a, seed ] = r8ss_random ( n, seed );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of nonzero entries stored is %d\n', na );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Diagonal storage indices:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : n
    fprintf ( 1, '%6d  %6d\n', i, diag(i) );
  end
%
%  Replace the random entries by marker values.
%
  ij = 0;
  for j = 1 : n

    if ( j == 1 )
      ilo = 1;
    else
      ilo = diag(j-1) - diag(j) + j + 1;
    end

    for i = ilo : j
      ij = ij + 1;
      a(ij) = 10 * i + j;
    end

  end

  r8ss_print ( n, na, diag, a, '  The R8SS matrix:' );
%
%  Copy the matrix into a general matrix.
%
  a2 = r8ss_to_r8ge ( n, na, diag, a );
%
%  Set the vector X.
%
  x = r8vec_indicator1 ( n );
%
%  Compute the product.
%
  b = r8ss_mv ( n, na, diag, a, x );
%
%  Compute the product using the general matrix.
%
  b2 = r8ge_mv ( n, n, a2, x );
%
%  Compare the results.
%
  r8vec2_print ( n, b, b2, '  R8SS_MV verse R8GE_MV' );

  return
end
