function eigs_nonsymmetric_test ( )

%*****************************************************************************80
%
%% eigs_nonsymmetric_test() tests eigs() on a nonysymmetric matrix.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    09 March 2018
%
%  Author:
%
%    John Burkardt
%
  n = 5;
  lambda_dev = 5.0;
  lambda_mean = 10.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'eigs_nonsymmetric_test():\n' );
  fprintf ( 1, '  Test eigs() on a nonsymmetric matrix.\n' );

  [ A, Q, T ] = r8nsymm_gen ( n, lambda_mean, lambda_dev );
%
%  Print the matrix.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Real nonsymmetric test matrix A:\n' );
  disp ( A )

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Orthogonal factor Q:\n' );
  disp ( Q );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Schur upper triangle T:\n' );
  disp ( T )

  lambda = diag ( T );
  lambda = sort ( lambda );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Sorted eigenvalues Lambda:\n' );
  disp ( lambda )
%
%  Call eigs.
%
  [ Q2, lambda2 ] = eigs ( A, n );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Computed eigenvectors Q2:\n' );
  disp ( Q2 )

  lambda2 = diag ( lambda2 );
  lambda2 = sort ( lambda2 );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Computed eigenvalues lambda2:\n' );
  disp ( lambda2 )
%
%  Errors.
%
  lambda_error = norm ( lambda - lambda2 );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Norm of eigenvalue error = %g\n', lambda_error );

  return
end
