function a = r83t_indicator ( m, n )

%*****************************************************************************80
%
%% R83T_INDICATOR sets the indicator matrix in R83T format.
%
%  Discussion:
%
%    The R83T storage format is used for an MxN tridiagonal matrix.
%    The superdiagonal is stored in entries (1:M-1,3), the diagonal in
%    entries (1:M,2), and the subdiagonal in (2:M,1).  Thus, the
%    the rows of the original matrix slide horizontally to form an
%    Mx3 stack of data.
%
%    An R83T matrix of order 3x5 would be stored:
%
%       *  A11 A12
%      A21 A22 A23
%      A32 A33 A34
%
%    An R83T matrix of order 5x5 would be stored:
%
%       *  A11 A12
%      A21 A22 A23
%      A32 A33 A34
%      A43 A44 A45
%      A54 A55  *
%
%    An R83T matrix of order 5x3 would be stored:
%
%       *  A11 A12
%      A21 A22 A23
%      A32 A33  *
%      A43  *   *
%       *   *   *
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    27 May 2016
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer M, the number of rows of the matrix.
%    M must be positive.
%
%    Input, integer N, the number of columns of the matrix.
%    N must be positive.
%
%    Output, real A(M,3), the matrix.
%
  fac = 10 ^ ( i4_log_10 ( n ) + 1 );

  a = zeros ( m, 3 );

  for i = 1 : m
    for k = 1 : 3
      j = i - 2 + k;
      if ( 1 <= j && j <= n )
        a(i,k) = fac * i + j;
      else
        a(i,k) = 0.0;
      end
    end
  end

  return
end