function r8mat_diag_add_scalar_test ( )

%*****************************************************************************80
%
%% R8MAT_DIAG_ADD_SCALAR_TEST tests R8MAT_DIAG_ADD_SCALAR.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 December 2014
%
%  Author:
%
%    John Burkardt
%
  n = 5;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8MAT_DIAG_ADD_SCALAR_TEST\n' );
  fprintf ( 1, '  R8MAT_DIAG_ADD_SCALAR adds a scalar to each diagonal\n' );
  fprintf ( 1, '  entry of an R8MAT.\n' );

  a = r8mat_indicator ( n, n );

  r8mat_print ( n, n, a, '  Initial matrix A:' );

  s = 7.0;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Using scalar S = %g\n', s );

  a2 = r8mat_diag_add_scalar ( n, a, s );
  r8mat_print ( n, n, a2, '  A + s*I:' );

  return
end
