function [ A, Q, T ] = r8nsymm_gen ( n, lambda_mean, lambda_dev )

%*****************************************************************************80
%
%% r8nsymm_gen() generates a nonsymmetric matrix with a certain eigenstructure.
%
%  Discussion:
%
%    We generate a real nonsymmetric matrix with real eigenvalues,
%    factored as A = Q' * T * Q where Q is orthogonal, 
%    and T is upper triangular.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    04 June 2024
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the order of the matrix.
%
%    real LAMBDA_MEAN, the mean value of the normal
%    distribution from which the eigenvalues will be chosen.
%
%    real LAMBDA_DEV, the standard deviation of the normal
%    distribution from which the eigenvalues will be chosen.
%
%  Output:
%
%    real A(N,N), the test matrix.
%
%    real Q(N,N), the orthogonal matrix.
%
%    real T(N,N), the upper triangular Schur matrix.
%
 
%
%  Get a random upper triangular matrix T.
%
  T = r8triangular_upper_gen ( n, lambda_mean, lambda_dev );
%
%  Get a random orthogonal matrix Q.
%
  Q = r8mat_orth_uniform ( n );
%
%  Set A = Q' * T * Q, 
%
  A = Q' * T * Q;

  return
end
