function A = reflection_random_inverse ( n, key )

%*****************************************************************************80
%
%% reflection_random_inverse: inverse of the REFLECTION_RANDOM matrix.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 May 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the order of A (default = 5 ).
%
%    integer KEY, a positive integer that selects the data.
%    (default = 123456789).
%
%  Output:
%
%    real A(N,N), the inverse matrix.
%
  if ( nargin < 2 )
    key = 123456789;
  end

  if ( nargin < 1 )
    n = 5;
  end

  rng ( key );
%
%  Get a random vector v.
%
  v = randn ( n, 1 );
%
%  Normalize.
%
  v = v / norm ( v );
%
%  A = I - 2 * v v'
%
  A = eye ( n, n ) - 2.0 * v * v';
%
%  Inverse is transpose.
%
  A = A';

  return
end
