function tridisolve_test ( )

%*****************************************************************************80
%
%% tridisolve_test tests tridisolve.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    09 January 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'tridisolve_test\n' );
  fprintf ( 1, '  tridisolve solves a tridiagonal linear system.\n' );
%
%  Set the array.
%
  n = 5;
  a = - ones ( n - 1, 1 );
  b = 2.0 * ones ( n, 1 );
  c = - ones ( n - 1, 1 );
  d = zeros ( n, 1 );
  d(n) = n + 1;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  subdiagonal, diagonal, superdiagonal:\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '            %8.4f  %8.4f\n',         b(1), c(1) );
  for i = 2 : n - 1
    fprintf ( 1, '  %8.4f  %8.4f  %8.4f\n', a(i-1), b(i), c(i) );
  end
  fprintf ( 1, '  %8.4f  %8.4f\n', a(n-1), b(n) );
%  
%
%  Set the right hand side as a column vector.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Right hand side d:\n' );
  fprintf ( 1, '\n' );
  disp ( d )
%
%  Request the solution of A*x=b.
%
  x = tridisolve ( a, b, c, d );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  x = tridisolve ( a, b, c, d ):\n' );
  fprintf ( 1, '\n' );
  disp ( x );

  return
end

