Next: Code for One Version
Up: How to call an
Previous: Example 1
Contents
Index
Example 2
The program in Fig. 3.2 illustrates the use of an LAPACK95
computational routine, LA_GEQRF, which computes the
QR factorization
of a square matrix A (). (See LA_GEQRF in Section 10.2).
Remarks:
 Statement 2 includes the la_precision.mod
module from LAPACK95 and sets the precision to single precision
(SP) via the internal parameter WP (working precision). If SP is
replaced by DP then the precision is set to double precision.
 Statement 3 includes the interface block
of the computational
routine LA_GEQRF from the f77_lapack.mod module of LAPACK95. All
computational routine interfaces belong to this module.
 Statement 7 defines
arguments A, TAU and WORK to be allocatable real singleprecision arrays.
The program works in complex arithmetic if REAL(WP) is replaced by COMPLEX(WP).
 Statements 910 allocate A, TAU and WORK and
assign data to array A.
 Statements 1113 calculate the optimal length
of the work array WORK and allocate this array.
 Statement 14 calls LA_GEQRF to compute the
QR factorization of the matrix in array A. On exit, details of the
factorization are stored in array A.
 Statement 18 prints the contents of A.
Figure 3.2:
Example program calling an LAPACK95 computational routine.

Next: Code for One Version
Up: How to call an
Previous: Example 1
Contents
Index
Susan Blackford
20010819