function r8mat_solve_3d_test ( )

%*****************************************************************************80
%
%% r8mat_solve_3d_test() tests r8mat_solve_3d().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 June 2011
%
%  Author:
%
%    John Burkardt
%
  n = 3;
  test_num = 5;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8MAT_SOLVE_3D_TEST\n' );
  fprintf ( 1, '  R8MAT_SOLVE_3D solves 3D linear systems.\n' );

  for test = 1 : test_num

    a = rand ( n, n );
    x = rand ( n, 1 );
    b(1:n,1) = a(1:n,1:n) * x(1:n);

    [ x2, det ] = r8mat_solve_3d ( a, b );

    fprintf ( 1, '\n' );
    fprintf ( 1, '  Solution / Computed:\n' );
    fprintf ( 1, '\n' );

    for i = 1 : n
      fprintf ( 1, '  %14f  %14f\n', x(i), x2(i) );
    end

  end

  return
end
