function r83v_cr_fa_test ( )

%*****************************************************************************80
%
%% R83V_CR_FA_TEST tests R83V_CR_FA.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 February 2016
%
%  Author:
%
%    John Burkardt
%
  n = 5;
  debug = 0;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R83V_CR_FA_TEST\n' );
  fprintf ( 1, '  R83V_CR_FA factors an R83V matrix;\n' );
  fprintf ( 1, '  Once the matrix has been factored, we can call\n' );
  fprintf ( 1, '  R83V_CR_SL to solve a linear system.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix order N = %d\n', n );
  fprintf ( 1, '  Demonstrate multiple system solution method.\n' );
  fprintf ( 1, '\n' );
%
%  Set the matrix values.
%
  [ a, b, c ] = r83v_dif2 ( n, n );
%
%  Print the matrix.
%
  r83v_print ( n, n, a, b, c, '  System matrix A:' );
%
%  Factor the matrix once.
%
  a_cr = r83v_cr_fa ( n, a, b, c );
%
%  Print the factor information.
%
  if ( debug )
    r83_print ( n, 2*n+1, a_cr, '  Cyclic reduction factor information:' );
  end 

  for j = 1 : 2

    fprintf ( 1, '\n' );
    fprintf ( 1, '  Solve linear system number #%d\n', j );

    if ( j == 1 ) 
      ax(1:n-1) = 0.0;
      ax(n) = n + 1;
    else
      ax(1) = 1.0;
      ax(2:n-1) = 0.0;
      ax(n) = 1.0;
    end
%
%  Solve the linear system.
%
    x = r83v_cr_sl ( n, a_cr, ax );

    r8vec_print ( n, x, '  Solution:' );

  end

  return
end

