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

%*****************************************************************************80
%
%% r8cmat_print_some() print a portion of an R8CMAT.
%
%  Discussion:
%
%    An R8CMAT is an MxN array of R8's, stored with a leading dimension
%    of LD, and hence accessed either as a double indexed array:
%      (I,J) -> (I,J) 
%    or as a vector:
%      (I,J) -> (I+J*LD).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 September 2014
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer LDA, the leading dimension of the matrix.
%    M <= LDA.
%
%    integer M, N, the number of rows and columns of the matrix.
%
%    real A(LDA,N), an M by N matrix to be printed.
%
%    integer ILO, JLO, the first row and column to print.
%
%    integer IHI, JHI, the last row and column to print.
%
%    string TITLE, a title.
%
  incx = 5;

  fprintf ( 1, '\n' );
  fprintf ( 1, '%s\n', title );

  if ( m <= 0 || n <= 0 )
    fprintf ( 1, '\n' );
    fprintf ( 1, '  (None)\n' );
    return
  end

  for j2lo = max ( jlo, 1 ): incx : min ( jhi, n )

    j2hi = j2lo + incx - 1;
    j2hi = min ( j2hi, n );
    j2hi = min ( j2hi, jhi );
    
    fprintf ( 1, '\n' );
    fprintf ( 1, '  Col: ' );

    for j = j2lo : j2hi
      fprintf ( 1, '%7d       ', j );
    end

    fprintf ( 1, '\n' );
    fprintf ( 1, '  Row\n' );

    i2lo = max ( ilo, 1 );
    i2hi = min ( ihi, m );

    for i = i2lo : i2hi

      fprintf ( 1, '%7d :', i );
      
      for j = j2lo : j2hi
        fprintf ( 1, '%12g  ', a(i,j) );
      end

      fprintf ( 1, '\n' );

    end

  end

  return
end

