function linpack_z_test10 ( )

%*****************************************************************************80
%
%% test10 tests zgtsl().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 June 2009
%
%  Author:
%
%    John Burkardt
%
  n = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'TEST10\n' );
  fprintf ( 1, '  For a complex tridiagonal matrix:\n' );
  fprintf ( 1, '  ZGTSL solves a linear system.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix order N = %d\n', n );
%
%  Set the matrix.
%
  c = zeros ( n, 1 );
  c(1) = 0.0;
  c(2:n) = crand ( n-1 );

  e = zeros ( n, 1 );
  e(1:n-1) = crand ( n-1 );
  e(n) = 0.0;

  d = zeros ( n, 1 );

  d(1:n-1) = d(1:n-1) - 2.0 * e(1:n-1);
  d(2:n)   = d(2:n) - 2.0 * c(2:n);
%
%  Set the desired solution.
%
  for i = 1 : n
    x(i) = complex ( i, 10 * i );
  end
%
%  Compute the corresponding right hand side.
%
  b(1) = d(1) * x(1) + e(1) * x(2);
  for i = 2 : n-1
    b(i) = c(i) * x(i-1) + d(i) * x(i) + e(i) * x(i+1);
  end
  b(n) = c(n) * x(n-1) + d(n) * x(n);
%
%  Solve the tridiagonal system.
%
  [ b, info ] = zgtsl ( n, c, d, e, b );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Computed                     Exact\n' );
  fprintf ( 1, '  Solution                     Solution\n' );
  fprintf ( 1, '\n' );
  for i = 1 : n
    fprintf ( 1, '  (%8f  %8f)  (%8f  %8f)\n', ...
      real ( b(i) ), imag ( b(i) ), real ( x(i) ), imag ( x(i) ) );
  end

  return
end
