function test_solution ( )

%*****************************************************************************80
%
%% test_solution() tests the linear solution computations.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    09 March 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'test_solution():\n' );
  fprintf ( 1, '  Compute the Frobenius norm of the solution error:\n' );
  fprintf ( 1, '    A * X - B\n' );
  fprintf ( 1, ...
    '  given MxN matrix A, NxK solution X, MxK right hand side B.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Title                    M     N     K       |A|' );
  fprintf ( 1, '            |A*X-B|\n' );
  fprintf ( 1, '\n' );
%
%  a123
%
  title = 'A123';
  m = 3;
  n = 3;
  k = 1;
  a = a123_matrix ( );
  b = a123_rhs ( );
  x = a123_solution ( );
  error_frobenius = r8mat_is_solution ( m, n, k, a, x, b );
  norm_frobenius = norm ( a, 'fro' );
  fprintf ( 1, '  %-20s  %4d  %4d  %4d  %14f  %14f\n', ...
    title, m, n, k, norm_frobenius, error_frobenius );
%
%  bodewig
%
  title = 'bodewig';
  m = 4;
  n = 4;
  k = 1;
  a = bodewig_matrix ( );
  b = bodewig_rhs ( );
  x = bodewig_solution ( );
  error_frobenius = r8mat_is_solution ( m, n, k, a, x, b );
  norm_frobenius = norm ( a, 'fro' );
  fprintf ( 1, '  %-20s  %4d  %4d  %4d  %14f  %14f\n', ...
    title, m, n, k, norm_frobenius, error_frobenius );
%
%  dif2
%
  title = 'dif2';
  m = 10;
  n = 10;
  k = 2;
  a = dif2_matrix ( m, n );
  b = dif2_rhs ( m, k );
  x = dif2_solution ( n, k );
  error_frobenius = r8mat_is_solution ( m, n, k, a, x, b );
  norm_frobenius = norm ( a, 'fro' );
  fprintf ( 1, '  %-20s  %4d  %4d  %4d  %14f  %14f\n', ...
    title, m, n, k, norm_frobenius, error_frobenius );
%
%  frank
%
  title = 'frank';
  m = 10;
  n = 10;
  k = 2;
  a = frank_matrix ( n );
  b = frank_rhs ( m, k );
  x = frank_solution ( n, k );
  error_frobenius = r8mat_is_solution ( m, n, k, a, x, b );
  norm_frobenius = norm ( a, 'fro' );
  fprintf ( 1, '  %-20s  %4d  %4d  %4d  %14f  %14f\n', ...
    title, m, n, k, norm_frobenius, error_frobenius );
%
%  poisson
%
  title = 'poisson';
  nrow = 4;
  ncol = 5;
  m = nrow * ncol;
  n = nrow * ncol;
  k = 1;
  a = poisson_matrix ( nrow, ncol );
  b = poisson_rhs ( nrow, ncol, k );
  x = poisson_solution ( nrow, ncol, k );
  error_frobenius = r8mat_is_solution ( m, n, k, a, x, b );
  norm_frobenius = norm ( a, 'fro' );
  fprintf ( 1, '  %-20s  %4d  %4d  %4d  %14f  %14f\n', ...
    title, m, n, k, norm_frobenius, error_frobenius );
%
%  wilk03
%
  title = 'wilk03';
  m = 3;
  n = 3;
  k = 1;
  a = wilk03_matrix ( );
  b = wilk03_rhs ( );
  x = wilk03_solution ( );
  error_frobenius = r8mat_is_solution ( m, n, k, a, x, b );
  norm_frobenius = norm ( a, 'fro' );
  fprintf ( 1, '  %-20s  %4d  %4d  %4d  %14f  %14f\n', ...
    title, m, n, k, norm_frobenius, error_frobenius );
%
%  wilk04
%
  title = 'wilk04';
  m = 4;
  n = 4;
  k = 1;
  a = wilk04_matrix ( );
  b = wilk04_rhs ( );
  x = wilk04_solution ( );
  error_frobenius = r8mat_is_solution ( m, n, k, a, x, b );
  norm_frobenius = norm ( a, 'fro' );
  fprintf ( 1, '  %-20s  %4d  %4d  %4d  %14f  %14f\n', ...
    title, m, n, k, norm_frobenius, error_frobenius );
%
%  wilson
%
  title = 'wilson';
  m = 4;
  n = 4;
  k = 1;
  a = wilson_matrix ( );
  b = wilson_rhs ( );
  x = wilson_solution ( );
  error_frobenius = r8mat_is_solution ( m, n, k, a, x, b );
  norm_frobenius = norm ( a, 'fro' );
  fprintf ( 1, '  %-20s  %4d  %4d  %4d  %14f  %14f\n', ...
    title, m, n, k, norm_frobenius, error_frobenius );

  return
end
