function r8vm_print_some ( m, n, a, ilo, jlo, ihi, jhi, title ) %*****************************************************************************80 % %% R8VM_PRINT_SOME prints some of a R8VM matrix. % % Discussion: % % The R8VM storage format is used for an M by N Vandermonde matrix. % An M by N Vandermonde matrix is defined by the values in its second % row, which will be written here as X(1:N). The matrix has a first % row of 1's, a second row equal to X(1:N), a third row whose entries % are the squares of the X values, up to the M-th row whose entries % are the (M-1)th powers of the X values. The matrix can be stored % compactly by listing just the values X(1:N). % % 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, real A(N), the R8VM 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 ); i2hi = min ( ihi, m ); 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 == 1 ) aij = 1.0E+00; else aij = a(j)^(i-1); end fprintf ( 1, '%12f ', aij ); end fprintf ( 1, '\n' ); end end fprintf ( 1, '\n' ); return end