function test_condition ( )

%*****************************************************************************80
%
%% test_condition() tests the condition number computations.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 October 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'test_condition():\n' );
  fprintf ( 1, '  For each example matrix, compute the L1 condition number,\n' );
  fprintf ( 1, '  COND1 as returned by test_matrix()\n' );
  fprintf ( 1, '  COND2 as computed by norm(A,1)*norm(Ainverse,1)\n' );
  fprintf ( 1, '  COND3 as computed by MATLAB cond(A,1).\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Title                    N           COND1           COND2           COND3\n' );
  fprintf ( 1, '\n' );
%
%  aegerter
%
  title = 'aegerter';
  n = 5;
  cond1 = aegerter_condition ( n );
  a = aegerter_matrix ( n );
  b = aegerter_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  antisummation
%
  title = 'antisummation';
  n = 5;
  cond1 = antisummation_condition ( n );
  a = antisummation_matrix ( n, n );
  b = antisummation_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  bab
%
  title = 'bab';
  n = 5;
  r8_lo = -5.0;
  r8_hi = +5.0;
  key = 123456789;
  rng ( key );
  alpha = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  beta = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  cond1 = bab_condition ( n, alpha, beta );
  a = bab_matrix ( n, alpha, beta );
  b = bab_inverse ( n, alpha, beta );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  bauer
%
  title = 'bauer';
  n = 6;
  cond1 = bauer_condition ( );
  a = bauer_matrix ( );
  b = bauer_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  bernstein
%
  title = 'bernstein';
  n = 10;
  cond1 = bernstein_condition ( n );
  a = bernstein_matrix ( n );
  b = bernstein_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  bis
%
  title = 'bis';
  n = 5;
  r8_lo = -5.0;
  r8_hi = +5.0;
  key = 123456789;
  rng ( key );
  alpha = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  beta = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  cond1 = bis_condition ( alpha, beta, n );
  a = bis_matrix ( alpha, beta,  n, n );
  b = bis_inverse ( alpha, beta, n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  biw
%
  title = 'biw';
  n = 5;
  cond1 = biw_condition ( n );
  a = biw_matrix ( n );
  b = biw_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  bodewig
%
  title = 'bodewig';
  n = 3;
  cond1 = bodewig_condition ( );
  a = bodewig_matrix ( );
  b = bodewig_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  boothroyd
%
  title = 'boothroyd';
  n = 5;
  cond1 = boothroyd_condition ( n );
  a = boothroyd_matrix ( n );
  b = boothroyd_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  combin
%
  title = 'combin';
  n = 3;
  r8_lo = -5.0;
  r8_hi = +5.0;
  key = 123456789;
  rng ( key );
  alpha = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  beta = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  cond1 = combin_condition ( alpha, beta, n );
  a = combin_matrix ( alpha, beta, n );
  b = combin_inverse ( alpha, beta, n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  companion
%
  title = 'companion';
  n = 5;
  r8_lo = -5.0;
  r8_hi = +10.0;
  key = 123456789;
  rng ( key );
  x = r8_lo + ( r8_hi - r8_lo ) * rand ( n, 1 );
  cond1 = companion_condition ( n, x );
  a = companion_matrix ( n, x );
  b = companion_inverse ( n, x );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  conex1
%
  title = 'conex1';
  n = 4;
  r8_lo = -5.0;
  r8_hi = +5.0;
  key = 123456789;
  rng ( key );
  alpha = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  cond1 = conex1_condition ( alpha );
  a = conex1_matrix ( alpha );
  b = conex1_inverse ( alpha );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  conex2
%
  title = 'conex2';
  n = 3;
  r8_lo = -5.0;
  r8_hi = +5.0;
  key = 123456789;
  rng ( key );
  alpha = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  cond1 = conex2_condition ( alpha );
  a = conex2_matrix ( alpha );
  b = conex2_inverse ( alpha );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  conex3
%
  title = 'conex3';
  n = 5;
  cond1 = conex3_condition ( n );
  a = conex3_matrix ( n );
  b = conex3_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  conex4
%
  title = 'conex4';
  n = 4;
  cond1 = conex4_condition ( );
  a = conex4_matrix ( );
  b = conex4_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  daub2
%
  title = 'daub2';
  n = 4;
  cond1 = daub2_condition ( n );
  a = daub2_matrix ( n );
  b = daub2_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  daub4
%
  title = 'daub4';
  n = 8;
  cond1 = daub4_condition ( n );
  a = daub4_matrix ( n );
  b = daub4_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  daub6
%
  title = 'daub6';
  n = 12;
  cond1 = daub6_condition ( n );
  a = daub6_matrix ( n );
  b = daub6_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  daub8
%
  title = 'daub8';
  n = 16;
  cond1 = daub8_condition ( n );
  a = daub8_matrix ( n );
  b = daub8_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  daub10
%
  title = 'daub10';
  n = 20;
  cond1 = daub10_condition ( n );
  a = daub10_matrix ( n );
  b = daub10_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  daub12
%
  title = 'daub12';
  n = 24;
  cond1 = daub12_condition ( n );
  a = daub12_matrix ( n );
  b = daub12_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  defective
%
  title = 'defective';
  n = 2;
  cond1 = defective_condition ( );
  a = defective_matrix ( );
  b = defective_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  diagonal
%
  title = 'diagonal';
  n = 5;
  r8_lo = -5.0;
  r8_hi = +10.0;
  key = 123456789;
  rng ( key );
  x = r8_lo + ( r8_hi - r8_lo ) * rand ( n, 1 );
  cond1 = diagonal_condition ( n, x );
  a = diagonal_matrix ( n, n, x );
  b = diagonal_inverse ( n, x );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  dif2
%
  title = 'dif2';
  n = 5;
  cond1 = dif2_condition ( n );
  a = dif2_matrix ( n, n );
  b = dif2_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  downshift
%
  title = 'downshift';
  n = 5;
  cond1 = downshift_condition ( n );
  a = downshift_matrix ( n );
  b = downshift_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  exchange
%
  title = 'exchange';
  n = 5;
  cond1 = exchange_condition ( n );
  a = exchange_matrix ( n, n );
  b = exchange_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  fibonacci2
%
  title = 'fibonacci2';
  n = 5;
  cond1 = fibonacci2_condition ( n );
  a = fibonacci2_matrix ( n );
  b = fibonacci2_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  fibonacci3
%
  title = 'fibonacci3';
  n = 5;
  cond1 = fibonacci3_condition ( n );
  a = fibonacci3_matrix ( n );
  b = fibonacci3_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  frank
%
  title = 'frank';
  n = 5;
  cond1 = frank_condition ( n );
  a = frank_matrix ( n );
  b = frank_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  gfpp
%
  title = 'gfpp';
  n = 5;
  r8_lo = -5.0;
  r8_hi = +5.0;
  key = 123456789;
  rng ( key );
  alpha = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  cond1 = gfpp_condition ( n, alpha );
  a = gfpp_matrix ( n, alpha );
  b = gfpp_inverse ( n, alpha );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  givens
%
  title = 'givens';
  n = 5;
  cond1 = givens_condition ( n );
  a = givens_matrix ( n, n );
  b = givens_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  hankel_n
%
  title = 'hankel_n';
  n = 5;
  cond1 = hankel_n_condition ( n );
  a = hankel_n_matrix ( n );
  b = hankel_n_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  harman
%
  title = 'harman';
  n = 8;
  cond1 = harman_condition ( );
  a = harman_matrix ( );
  b = harman_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  hartley
%
  title = 'hartley';
  n = 5;
  cond1 = hartley_condition ( n );
  a = hartley_matrix ( n );
  b = hartley_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  identity
%
  title = 'identity';
  n = 5;
  cond1 = identity_condition ( n );
  a = identity_matrix ( n, n );
  b = identity_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  ill3
%
  title = 'ill3';
  n = 3;
  cond1 = ill3_condition ( );
  a = ill3_matrix ( );
  b = ill3_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  involutory
%
  title = 'involutory';
  n = 5;
  cond1 = involutory_condition ( n );
  a = involutory_matrix ( n );
  b = involutory_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  jordan
%
  title = 'jordan';
  n = 5;
  r8_lo = -5.0;
  r8_hi = +5.0;
  key = 123456789;
  rng ( key );
  alpha = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  cond1 = jordan_condition ( n, alpha );
  a = jordan_matrix ( n, n, alpha );
  b = jordan_inverse ( n, alpha );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  kershaw
%
  title = 'kershaw';
  n = 4;
  cond1 = kershaw_condition ( );
  a = kershaw_matrix ( );
  b = kershaw_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  kms
%
  title = 'kms';
  alpha = 2.0;
  n = 5;
  cond1 = kms_condition ( alpha, n );
  a = kms_matrix ( alpha, n, n );
  b = kms_inverse ( alpha, n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  lehmer
%
  title = 'lehmer';
  n = 5;
  cond1 = lehmer_condition ( n );
  a = lehmer_matrix ( n, n );
  b = lehmer_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  lietzke
%
  title = 'lietzke';
  n = 5;
  cond1 = lietzke_condition ( n );
  a = lietzke_matrix ( n );
  b = lietzke_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  maxij
%
  title = 'maxij';
  n = 5;
  cond1 = maxij_condition ( n );
  a = maxij_matrix ( n, n );
  b = maxij_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  minij
%
  title = 'minij';
  n = 5;
  cond1 = minij_condition ( n );
  a = minij_matrix ( n, n );
  b = minij_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  orthogonal_symmetric
%
  title = 'orthogonal_symmetric';
  n = 5;
  cond1 = orthogonal_symmetric_condition ( n );
  a = orthogonal_symmetric_matrix ( n );
  b = orthogonal_symmetric_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  oto
%
  title = 'oto';
  n = 5;
  cond1 = oto_condition ( n );
  a = oto_matrix ( n, n );
  b = oto_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  pascal1
%
  title = 'pascal1';
  n = 5;
  cond1 = pascal1_condition ( n );
  a = pascal1_matrix ( n );
  b = pascal1_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  pascal3
%
  title = 'pascal3';
  n = 5;
  r8_lo = 1.0;
  r8_hi = 10.0;
  key = 123456789;
  rng ( key );
  alpha = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  cond1 = pascal3_condition ( n, alpha );
  a = pascal3_matrix ( n, alpha );
  b = pascal3_inverse ( n, alpha );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  pei
%
  title = 'pei';
  n = 5;
  r8_lo = 1.0;
  r8_hi = 10.0;
  key = 123456789;
  rng ( key );
  alpha = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  cond1 = pei_condition ( alpha, n );
  a = pei_matrix ( alpha, n );
  b = pei_inverse ( alpha, n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  permutation_random
%
  title = 'permutation_random';
  n = 5;
  key = 123456789;
  cond1 = permutation_random_condition ( n, key );
  a = permutation_random_matrix ( n, key );
  b = permutation_random_inverse ( n, key );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  rodman
%
  title = 'rodman';
  n = 5;
  r8_lo = 1.0;
  r8_hi = 10.0;
  key = 123456789;
  rng ( key );
  alpha = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  cond1 = rodman_condition ( n, alpha );
  a = rodman_matrix ( n, n, alpha );
  b = rodman_inverse ( n, alpha );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  rutis1
%
  title = 'rutis1';
  n = 4;
  cond1 = rutis1_condition ( );
  a = rutis1_matrix ( );
  b = rutis1_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  rutis2
%
  title = 'rutis2';
  n = 4;
  cond1 = rutis2_condition ( );
  a = rutis2_matrix ( );
  b = rutis2_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  rutis3
%
  title = 'rutis3';
  n = 4;
  cond1 = rutis3_condition ( );
  a = rutis3_matrix ( );
  b = rutis3_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  rutis5
%
  title = 'rutis5';
  n = 4;
  cond1 = rutis5_condition ( );
  a = rutis5_matrix ( );
  b = rutis5_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  summation
%
  title = 'summation';
  n = 5;
  cond1 = summation_condition ( n );
  a = summation_matrix ( n, n );
  b = summation_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  sweet1
%
  title = 'sweet1';
  n = 6;
  cond1 = sweet1_condition ( );
  a = sweet1_matrix ( );
  b = sweet1_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  sweet2
%
  title = 'sweet2';
  n = 6;
  cond1 = sweet2_condition ( );
  a = sweet2_matrix ( );
  b = sweet2_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  sweet3
%
  title = 'sweet3';
  n = 6;
  cond1 = sweet3_condition ( );
  a = sweet3_matrix ( );
  b = sweet3_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  sweet4
%
  title = 'sweet4';
  n = 13;
  cond1 = sweet4_condition ( );
  a = sweet4_matrix ( );
  b = sweet4_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  tri_upper
%
  title = 'tri_upper';
  n = 5;
  r8_lo = -5.0;
  r8_hi = +5.0;
  key = 123456789;
  rng ( key );
  alpha = r8_lo + ( r8_hi - r8_lo ) * rand ( 1, 1 );
  cond1 = tri_upper_condition ( alpha, n );
  a = tri_upper_matrix ( alpha, n );
  b = tri_upper_inverse ( alpha, n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  upshift
%
  title = 'upshift';
  n = 5;
  cond1 = upshift_condition ( n );
  a = upshift_matrix ( n );
  b = upshift_inverse ( n );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  wilk03
%
  title = 'wilk03';
  n = 3;
  cond1 = wilk03_condition ( );
  a = wilk03_matrix ( );
  b = wilk03_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  wilk04
%
  title = 'wilk04';
  n = 4;
  cond1 = wilk04_condition ( );
  a = wilk04_matrix ( );
  b = wilk04_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  wilk05
%
  title = 'wilk05';
  n = 5;
  cond1 = wilk05_condition ( );
  a = wilk05_matrix ( );
  b = wilk05_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );
%
%  wilson
%
  title = 'wilson';
  n = 4;
  cond1 = wilson_condition ( );
  a = wilson_matrix ( );
  b = wilson_inverse ( );
  a_norm = norm ( a, 1 );
  b_norm = norm ( b, 1 );
  cond2 = a_norm * b_norm;
  cond3 = cond ( a, 1);
  fprintf ( 1, '  %-20s  %4d  %14.6g  %14.6g  %14.6g\n', title, n, cond1, cond2, cond3 );

  return
end
