WRRRN

Prints a real rectangular matrix with integer row and column labels.

Required Arguments

TITLE — Character string specifying the title. (Input)
TITLE set equal to a blank character(s) suppresses printing of the title. Use “% /” within the title to create a new line. Long titles are automatically wrapped.

ANRA by NCA matrix to be printed. (Input)

Optional Arguments

NRA — Number of rows. (Input)
Default: NRA = size (A,1).

NCA — Number of columns. (Input)
Default: NCA = size (A,2).

LDA — Leading dimension of A exactly as specified in the dimension statement in the calling program. (Input)
Default: LDA = size (A,1).

ITRING — Triangle option. (Input)
Default: ITRING = 0.

 

ITRING

Action

0

Full matrix is printed.

1

Upper triangle of A is printed, including the diagonal.

2

Upper triangle of A excluding the diagonal of A is printed.

1

Lower triangle of A is printed, including the diagonal.

2

Lower triangle of A excluding the diagonal of A is printed.

FORTRAN 90 Interface

Generic: CALL WRRRN (TITLE, A [])

Specific: The specific interface names are S_WRRRN and D_WRRRN for two dimensional arrays, and S_WRRRN1D and D_WRRRN1D for one dimensional arrays.

FORTRAN 77 Interface

Single: CALL WRRRN (TITLE, NRA, NCA, A, LDA, ITRING)

Double: The double precision name is DWRRRN.

Description

Routine WRRRN prints a real rectangular matrix with the rows and columns labeled 1, 2, 3, and so on. WRRRN can restrict printing to the elements of the upper or lower triangles of matrices via the ITRING option. Generally, ITRING  0 is used with symmetric matrices.

In addition, one‑dimensional arrays can be printed as column or row vectors. For a column vector, set NRA to the length of the array and set NCA = 1. For a row vector, set NRA = 1 and set NCA to the length of the array. In both cases, set LDA = NRA and set ITRING = 0.

Comments

1. A single D, E, or F format is chosen automatically in order to print 4 significant digits for the largest element of A in absolute value. Routine WROPT can be used to change the default format.

2. Horizontal centering, a method for printing large matrices, paging, printing a title on each page, and many other options can be selected by invoking WROPT.

3. A page width of 78 characters is used. Page width and page length can be reset by invoking PGOPT.

4. Output is written to the unit specified by UMACH (see the Reference Material).

Example

The following example prints all of a 3 × 4 matrix A where aij= i + j/10.

 

USE WRRRN_INT

 

IMPLICIT NONE

INTEGER ITRING, LDA, NCA, NRA

PARAMETER (ITRING=0, LDA=10, NCA=4, NRA=3)

!

INTEGER I, J

REAL A(LDA,NCA)

!

DO 20 I=1, NRA

DO 10 J=1, NCA

A(I,J) = I + J*0.1

10 CONTINUE

20 CONTINUE

! Write A matrix.

CALL WRRRN ('A', A, NRA=NRA)

END

Output

 

A

1 2 3 4

1 1.100 1.200 1.300 1.400

2 2.100 2.200 2.300 2.400

3 3.100 3.200 3.300 3.400