function b = r8ltt_inverse ( n, a )

%*****************************************************************************80
%
%% R8LTT_INVERSE computes the inverse of a R8LTT matrix.
%
%  Discussion:
%
%    The R8LTT storage format is used for an N by N lower triangular Toeplitz
%    matrix.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 November 2015
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the order of the matrix.
%
%    Input, real A(N), the matrix to be inverted.
%
%    Output, real B(N), the inverse matrix.
%

%
%  Destroy all row vectors!
%
  a = a(:);
%
%  Initialize B.
%
  d = 1.0 / a(1);
  b = zeros ( n, 1 );
  b(1) = d; 
%
%  Set the strict lower triangle.
%
  p(1:n,1) = a(1:n,1);
  p(1) = 0.0;
%
%  PN will hold powers of P.
%
  pn(1:n) = zeros ( n, 1 );
  pn(1) = 1.0;
%
%  Add N-1 powers of strict lower triangle.
%
  for i = 2 : n
    d = - d / a(1);
    pn = r8ltt_mm ( n, p, pn );
    b = b + d  * pn;
  end

  return
end
