function dspr_test ( )

%*****************************************************************************80
%
%% DSPR_TEST tests DSPR.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    22 March 2017
%
%  Author:
%
%    John Burkardt
%
  n = 5;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'DSPR_TEST\n' );
  fprintf ( 1, '  DSPR computes A := A + alpha * x * x''\n' );
  fprintf ( 1, '  for a symmetric packed band matrix A.\n' );

  uplo = 'U';
  alpha = 2.0;
  incx = 1;

  ap = zeros ( ( n * ( n + 1 ) ) / 2, 1 );

  k = 0;
  for j = 1 : n
    for i = 1 : j
      k = k + 1;
      if ( i == j )
        ap(k) = 2.0;
      elseif ( i == j - 1 )
        ap(k) = -1.0;
      else
        ap(k) = 0.0;
      end

    end
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  A:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : n
    for j = 1 : i - 1
      k = triangle_upper_to_i4 ( j, i );
      fprintf ( 1, '%8.2f', ap(k) );
    end
    for j = i : n
      k = triangle_upper_to_i4 ( i, j );
      fprintf ( 1, '%8.2f', ap(k) );
    end
    fprintf ( 1, '\n' );
  end

  x = zeros ( n, 1 );

  for i = 1 : n
    x(i) = i;
  end

  ap = dspr ( uplo, n, alpha, x, incx, ap );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  A = A + alpha*x*x'':\n' );
  fprintf ( 1, '\n' );
  for i = 1 : n
    for j = 1 : i - 1
      k = triangle_upper_to_i4 ( j, i );
      fprintf ( 1, '%8.2f', ap(k) );
    end
    for j = i : n
      k = triangle_upper_to_i4 ( i, j );
      fprintf ( 1, '%8.2f', ap(k) );
    end
    fprintf ( 1, '\n' );
  end


  return
end