function A = eigen_test ( nprob )
%
% function A = eigen_test ( nprob )
%
%  Discussion:
%
%    EIGEN_TEST returns a test matrix for eigenproblems.
%
%  Modified:
%
%    10 April 2000
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, real NPROB, the problem number, between 1 and 5.
%
%    Output, real A(N,N), a test matrix.
%

%
%  Eigenvalues are 2, -1, 1/2.
%
if ( nprob == 1 )

  A = [ -1.0  -1.5   1.5;
         6.0   5.0  -6.0;
         3.0   1.5  -2.5 ];
%
%  Eigenvalues are 2, -2, 1+sqrt(3)i, 1-sqrt(3)i
%
elseif ( nprob == 2 )

  A = [  2.4 -4.4  2.0  1.6;
         2.8 -4.8  2.0  3.2;
         3.2 -5.2  4.0  0.8
         3.6 -3.6  2.0  0.4 ];
%
%  Eigenvalues are 9.62, -0.62, 0
%  (See your textbook, page 605).
%
elseif ( nprob == 3 )

  A = [  1 2 3;
         2 3 4;
         3 4 5 ];
%
%  Eigenvalues are 0.20, 0.75, 1.55, 2.45, 3.24, 3.80.
%  (See your textbook, page 620).
%
elseif ( nprob == 4 )

  A = [  2 1 0 0 0 0;
         1 2 1 0 0 0;
         0 1 2 1 0 0;
         0 0 1 2 1 0;
         0 0 0 1 2 1;
         0 0 0 0 1 2 ];
%
%  Eigenvalues are 4.73, 3.0, 1.27
%  (See your textbook, page 624).
%
elseif ( nprob == 5 )

  A = [  2 1 0;
         1 3 1;
         0 1 4 ];
%
%  No such problem.
%
else
  printf ( '\n' );
  printf ( 'EIGEN_TEST - Error!\n' );
  printf ( '  No such problem number!\n' );
  A = [];
end
