function r8cb_print_some ( m, n, ml, mu, a, ilo, jlo, ihi, jhi, title ) %*****************************************************************************80 % %% R8CB_PRINT_SOME prints some of a R8CB matrix. % % Discussion: % % The R8CB storage format is appropriate for a compact banded matrix. % It is assumed that the matrix has lower and upper bandwidths ML and MU, % respectively. The matrix is stored in a way similar to that used % by LINPACK and LAPACK for a general banded matrix, except that in % this mode, no extra rows are set aside for possible fillin during pivoting. % Thus, this storage mode is suitable if you do not intend to factor % the matrix, or if you can guarantee that the matrix can be factored % without pivoting. % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 07 April 2006 % % Author: % % John Burkardt % % Parameters: % % Input, integer M, N, the number of rows and columns of the matrix. % % Input, integer ML, MU, the lower and upper bandwidths. % ML and MU must be nonnegative, and no greater than min(M,N)-1. % % Input, real A(ML+MU+1,N), the R8CB 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. % fprintf ( 1, '\n' ); fprintf ( 1, '%s\n', title ); 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 - mu ); i2hi = min ( ihi, m ); 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 ( ml < i - j | mu < j - i ) fprintf ( 1, ' ' )'; else fprintf ( 1, '%12f ', a(i-j+mu+1,j) ); end end fprintf ( 1, '\n' ); end end fprintf ( 1, '\n' ); return end