function r8cbb_add_test ( )

%*****************************************************************************80
%
%% R8CBB_ADD_TEST tests R8CBB_ADD.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    23 July 2016
%
%  Author:
%
%    John Burkardt
%
  n1 = 3;
  n2 = 2;
  n = n1 + n2;
  ml = 1;
  mu = 0;
  na = ( ml + mu + 1 ) * n1 + 2 * n1 * n2 + n2 * n2;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8CBB_ADD_TEST\n' );
  fprintf ( 1, '  R8CBB_ADD adds a value to elements of an R8CBB matrix.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix order N =     %d\n', n );
  fprintf ( 1, '  Matrix suborder N1 = %d\n', n1 );
  fprintf ( 1, '  Matrix suborder N2 = %d\n', n2 );
  fprintf ( 1, '  Lower bandwidth ML = %d\n', ml );
  fprintf ( 1, '  Upper bandwidth MU = %d\n', mu );
%
%  Initialize matrix to indicator matrix.
%
  a = r8cbb_indicator ( n1, n2, ml, mu );
%
%  Print initial matrix.
%
  r8cbb_print ( n1, n2, ml, mu, a, '  Matrix before additions:' );
%
%  Add 100 to band diagonal.
%
  for i = 1 : n1
    j = i;
    value = 100.0;
    a = r8cbb_add ( n1, n2, ml, mu, a, i, j, value );
  end
%
%  Add 200 to right border.
%
  for i = 1 : n1
    for j = n1 + 1 : n1 + n2
      value = 200.0;
      a = r8cbb_add ( n1, n2, ml, mu, a, i, j, value );
    end
  end
%
%  Add 400 to offdiagonals in lower right dense matrix.
%
  for i = n1 + 1 : n1 + n2
    for j = n1 + 1 : n1 + n2
      if ( i ~= j )
        value = 400.0;
        a = r8cbb_add ( n1, n2, ml, mu, a, i, j, value );
      end
    end
  end

  r8cbb_print ( n1, n2, ml, mu, a, '  The R8BB matrix after additions:' );

  return
end
