function r8gb_mu_test ( )

%*****************************************************************************80
%
%% R8GB_MU_TEST tests R8GB_MU.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 June 2016
%
%  Author:
%
%    John Burkardt
%
  m = 10;
  n = m;
  ml = 1;
  mu = 2;
  seed = 123456789;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8GB_MU_TEST\n' );
  fprintf ( 1, '  R8GB_MU computes A*x or A''*X\n' );
  fprintf ( 1, '  where A has been factored by R8GB_TRF.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix rows M              = %d\n', m );
  fprintf ( 1, '  Matrix columns N           = %d\n', n );
  fprintf ( 1, '  Lower bandwidth ML         = %d\n', ml );
  fprintf ( 1, '  Upper bandwidth MU         = %d\n', mu );

  for job = 0 : 1
%
%  Set the matrix.
%
    [ a, seed ] = r8gb_random ( m, n, ml, mu, seed );
%
%  Set the desired solution.
%
    x = r8vec_indicator1 ( n );
%
%  Compute the corresponding right hand side.
%
    if ( job == 0 )
      b = r8gb_mv ( m, n, ml, mu, a, x );
    else
      b = r8gb_mtv ( m, n, ml, mu, a, x );
    end
%
%  Factor the matrix.
%
    [ a_lu, pivot, info ] = r8gb_trf ( m, n, ml, mu, a );

    if ( info ~= 0 )
      fprintf ( 1, '\n' );
      fprintf ( 1, 'R8GB_MU_TEST - Fatal error!\n' );
      fprintf ( 1, '  R8GB_TRF declares the matrix is singular!\n' );
      fprintf ( 1, '  The value of INFO is %d\n', info );
      return
    end
%
%  Now multiply factored matrix times solution to get right hand side again.
%
    b2 = r8gb_mu ( n, ml, mu, a_lu, pivot, x, job );

    if ( job == 0 )
      r8vec2_print ( n, b, b2, '  A*x and PLU*x' );
    else
      r8vec2_print ( n, b, b2, '  A''*x and (PLU)''*x' );
    end

  end

  return
end
