function r83t_print_some ( m, n, a, ilo, jlo, ihi, jhi, title )

%*****************************************************************************80
%
%% R83T_PRINT_SOME prints some of an R83T matrix.
%
%  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, N, the order of the matrix.
%
%    Input, real A(M,N), the R83 matrix.
%
%    Input, integer ILO, JLO, IHI, JHI, the first row and
%    column, and the last row and column, to be printed.
%
%    Input, string TITLE, a title.
%
  if ( 0 < length ( title ) )
    fprintf ( 1, '\n' );
    fprintf ( 1, '%s\n', title );
  end

  incx = 5;
%
%  Print the columns of the matrix, in strips of 5.
%
  for j2lo = jlo : incx : jhi

    j2hi = j2lo + incx - 1;
    j2hi = min ( j2hi, n );
    j2hi = min ( j2hi, jhi );

    inc = j2hi + 1 - j2lo;

    fprintf ( 1, '\n' );
    fprintf ( 1, '  Col: ' );
    for j = j2lo : j2hi
      fprintf ( 1, '%7d       ', j );
    end
    fprintf ( 1, '\n' );
    fprintf ( 1, '  Row\n' );
    fprintf ( 1, '  ---\n' );
%
%  Determine the range of the rows in this strip.
%
    i2lo = max ( ilo, 1 );
    i2lo = max ( i2lo, j2lo - 1 );
    i2hi = min ( ihi, m );
    i2hi = min ( i2hi, j2hi + 1 );

    for i = i2lo : i2hi
%
%  Print out (up to) 5 entries in row I, that lie in the current strip.
%
      fprintf ( 1, '%5d:', i );

      for j2 = 1 : inc

        j = j2lo - 1 + j2;
        k = j - i + 2;
        if ( k < 1 || 3 < k )
          fprintf ( 1, '              ' );
        else
          fprintf ( 1, '%14g', a(i,k) );
        end

      end

      fprintf ( 1, '\n' );

    end

  end

  return
end
