function r8pbl_print_some ( n, ml, a, ilo, jlo, ihi, jhi, title )

%*****************************************************************************80
%
%% r8pbl_print_some() prints some of a R8PBL matrix.
%
%  Discussion:
%
%    The R8PBL storage format is for a symmetric positive definite band matrix.
%
%    To save storage, only the diagonal and lower triangle of A is stored,
%    in a compact diagonal format that preserves columns.
%
%    The diagonal is stored in row 1 of the array.
%    The first subdiagonal in row 2, columns 1 through ML.
%    The second subdiagonal in row 3, columns 1 through ML-1.
%    The ML-th subdiagonal in row ML+1, columns 1 through 1.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 July 2016
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the order of the matrix.
%    N must be positive.
%
%    Input, integer ML, the upper (and lower) bandwidth.
%    ML must be nonnegative, and no greater than N-1.
%
%    Input, real A(ML+1,N), the R8PBL 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 - ml );
    i2hi = min ( ihi, n );
    i2hi = min ( i2hi, j2hi + ml );

    for i = i2lo : i2hi

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

        j = j2lo - 1 + j2;

        if ( i <= j && j <= i + ml )
          aij = a(j-i+1,i);
        elseif ( j <= i && i <= j + ml )
          aij = a(i-j+1,j);
        else
          aij = 0.0E+00;
        end

        if ( ml < i - j || ml < j - i )
          fprintf ( 1, '              ' );
        else
          fprintf ( 1, '%12g  ', aij );
        end

      end

      fprintf ( 1, '\n' );

    end

  end

  return
end

