function t = adj_to_transit ( n, a )

%*****************************************************************************80
%
%% ADJ_TO_TRANSIT converts an adjacency matrix to a transition matrix.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    07 September 2015
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Output, integer A(N,N), the adjacency matrix.
%
%    Output, real T(N,N), the transition matrix.
%
  s = sum ( a, 2 );
  for i = 1 : n
    if ( s(i) ~= 0.0 )
      t(i,:) = a(i,:) / s(i);
    end
  end

  t = t';

  return
end
