function dgbmv_test ( )

%*****************************************************************************80
%
%% DGBMV_TEST tests DGBMV.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    19 March 2017
%
%  Author:
%
%    John Burkardt
%
  m = 5;
  n = 5;
  kl = 1;
  ku = 1;
  lda = kl + 1 + ku;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'DGBMV_TEST\n' );
  fprintf ( 1, '  DGBMV computes y := alpha * A * x + beta * y\n' );
  fprintf ( 1, '  for a general band matrix A.\n' );

  trans = 'N';
  alpha = 2.0;
  incx = 1;
  beta = 3.0;
  incy = 1;

  a = zeros ( lda, n );

  for i = 1 : m

    jlo = max ( 1, i - kl );
    jhi = min ( n, i + ku );

    for j = jlo : jhi

      if ( i == j )
        a(ku+1+i-j,j) = 2.0;
      elseif ( i == j - 1 || i == j + 1 )
        a(ku+1+i-j,j) = -1.0;
      else
        a(ku+1+i-j,j) = 0.0;
      end

    end
  end

  x = zeros ( n, 1 );

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

  y = zeros ( m, 1 );

  for i = 1 : m
    y(i) = 10 * i;
  end

  y = dgbmv ( trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy );

  r8vec_print ( m, y, '  Result vector y:' );

  return
end