function r83_cr_sl_test ( )

%*****************************************************************************80
%
%% r83_cr_sl_test() tests r83_cr_sl().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 August 2015
%
%  Author:
%
%    John Burkardt
%
  n = 5;
  debug = 0;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R83_CR_SL_TEST\n' );
  fprintf ( 1, '  R83_CR_SL solves a factored system\n' );
  fprintf ( 1, '  after R83_CR_FA has factored it.\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 = zeros ( 3, n );

  for j = 1 : n
    for i = max ( 1, j - 1 ) : min ( n, j + 1 )
      if ( j == i - 1 )
        value = j;
      elseif ( j == i )
        value = 4 * j;
      elseif ( j == i + 1 )
        value = j;
      end
      a(i-j+2,j) = value;
    end
  end
%
%  Print the matrix.
%
  r83_print ( n, n, a, '  Input matrix A:' );
%
%  Set the desired solution.
%
  x = r8vec_indicator1 ( n );
%
%  Compute the right hand side.
%
  b = r83_mv ( n, n, a, x );
  x(1:n) = 0.0;
%
%  Factor the matrix.
%
  a_cr = r83_cr_fa ( n, a );
%
%  Solve the linear system.
%
  x = r83_cr_sl ( n, a_cr, b );

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

  return
end

