function test_null_right ( )

%*****************************************************************************80
%
%% test_null_right() tests right null vectors.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 January 2021
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'test_null_right():\n' );
  fprintf ( 1, '  A = a test matrix of order M by N;\n' );
  fprintf ( 1, '  x = an N vector, candidate for a right null vector.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  ||A|| = Frobenius norm of A.\n' );
  fprintf ( 1, '  ||x|| = L2 norm of x.\n' );
  fprintf ( 1, '  ||A*x||/||x|| = L2 norm of A*x over L2 norm of x.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Title                    M     N      ' );
  fprintf ( 1, '    ||A||        ||x||        ||A*x||/||x||\n' );
  fprintf ( 1, '\n' );
%
%  a123
%
  title = 'a123';
  m = 3;
  n = 3;
  a = a123_matrix ( );
  x = a123_null_right ( );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  archimedes
%
  title = 'archimedes';
  m = 7;
  n = 8;
  a = archimedes_matrix ( );
  x = archimedes_null_right ( );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  cheby_diff1
%
  title = 'cheby_diff1';
  m = 5;
  n = m;
  a = cheby_diff1_matrix ( n );
  x = cheby_diff1_null_right ( m, n );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  creation
%
  title = 'creation';
  m = 5;
  n = m;
  a = creation_matrix ( m, n );
  x = creation_null_right ( m, n );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  dif1
%
  title = 'dif1';
  m = 5;
  n = m;
  a = dif1_matrix ( m, n );
  x = dif1_null_right ( m, n );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  dif1cyclic
%
  title = 'dif1cyclic';
  m = 5;
  n = m;
  a = dif1cyclic_matrix ( n );
  x = dif1cyclic_null_right ( m, n );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  dif2cyclic
%
  title = 'dif2cyclic';
  m = 5;
  n = m;
  a = dif2cyclic_matrix ( n );
  x = dif2cyclic_null_right ( m, n );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  fibonacci1
%
  title = 'fibonacci1';
  m = 5;
  n = m;
  r8_lo = -5.0;
  r8_hi = +5.0;
  key = 123456789;
  rng ( key );
  f1 = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  f2 = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  a = fibonacci1_matrix ( n, f1, f2 );
  x = fibonacci1_null_right ( m, n, f1, f2 );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  hamming
%
  title = 'hamming';
  m = 5;
  n = ( 2 ^ m ) - 1;
  a = hamming_matrix ( m, n );
  x = hamming_null_right ( m, n );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  line_adj
%
  title = 'line_adj';
  m = 7;
  n = m;
  a = line_adj_matrix ( n );
  x = line_adj_null_right ( m, n );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  moler2
%
  title = 'moler2';
  m = 5;
  n = 5;
  a = moler2_matrix ( );
  x = moler2_null_right ( );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  neumann
%
  title = 'neumann';
  row_num = 5;
  col_num = 5;
  m = row_num * col_num;
  n = row_num * col_num;
  a = neumann_matrix ( row_num, col_num );
  x = neumann_null_right ( row_num, col_num );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  one
%
  title = 'one';
  m = 5;
  n = 5;
  a = one_matrix ( m, n );
  x = one_null_right ( m, n );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  ring_adj
%
  title = 'ring_adj';
  m = 12;
  n = 12;
  a = ring_adj_matrix ( n );
  x = ring_adj_null_right ( m, n );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  rosser1
%
  title = 'rosser1';
  m = 8;
  n = 8;
  a = rosser1_matrix ( );
  x = rosser1_null_right ( );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );
%
%  zero
%
  title = 'zero';
  m = 5;
  n = 5;
  a = zero_matrix ( m, n );
  x = zero_null_right ( n );
  error_l2 = r8mat_is_null_right ( m, n, a, x );
  norm_a_frobenius = norm ( a, 'fro' );
  norm_x_l2 = r8vec_norm_l2 ( n, x );
  fprintf ( 1, '  %-20s  %4d  %4d  %14g  %14g  %10.2g\n', ...
    title, m, n, norm_a_frobenius, norm_x_l2, error_l2 );

  return
end
