function [ a, ql, qr, lambda, seed ] = r8symm_gen ( n, lambda_mean, ...
  lambda_dev, seed )

%*****************************************************************************80
%
%% R8NSYMM_GEN generates a nonsymmetric matrix with a certain eigenstructure.
%
%  Discussion:
%
%    An R8NSYMM is a real nonsymmetric matrix stored using full storage, and
%    using R8 arithmetic.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    09 March 2018
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the order of the matrix.
%
%    Input, real LAMBDA_MEAN, the mean value of the normal
%    distribution from which the eigenvalues will be chosen.
%
%    Input, real LAMBDA_DEV, the standard deviation of the normal
%    distribution from which the eigenvalues will be chosen.
%
%    Input/output, integer SEED, a seed for the random
%    number generator.
%
%    Output, real A(N,N), the test matrix.
%
%    Output, real QL(N,N), the left eigenvector matrix.
%
%    Output, real QR(N,N), the right eigenvector matrix.
%
%    Output, real LAMBDA(N), the eigenvalue vector.
%
 
%
%  Choose the eigenvalues LAMBDA.
%
  [ lambda, seed ] = r8vec_normal_ab ( n, lambda_mean, lambda_dev, seed );
%
%  Get random orthogonal matrices QL and QR.
%
  [ ql, seed ] = r8mat_orth_uniform ( n, seed );
  [ qr, seed ] = r8mat_orth_uniform ( n, seed );
%
%  Set A = QL * Lambda*I * QR'.
%
  a = ql * diag ( lambda ) * qr';

  return
end
