Next: Example 2
Up: How to call an
Previous: How to call an
  Contents
  Index
Example 1
The program in Fig. 3.1 illustrates the use of an LAPACK95
driver routine, LA_GESV. This routine solves a linear system of
equations , where is a square matrix and B is a vector
or matrix containing the right-hand side vector(s). (See Section 5.1.1).
In this application B is a matrix.
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 driver
routine LA_GESV from the f95_lapack.mod module of LAPACK95. All
driver routine interfaces are contained in this module.
- Statement 7 defines
arguments A and B to be allocatable real single-precision arrays.
The program works in complex arithmetic if REAL(WP) is replaced by COMPLEX(WP).
- Statements 9-11 allocate A and B and
assign data to these arrays.
- Statement 12 calls LA_GESV to solve
the system. On exit, the solution matrix X is stored in array B.
- Statement 15 prints X.
Figure 3.1:
Example program calling an LAPACK95 driver routine.
|
Next: Example 2
Up: How to call an
Previous: How to call an
  Contents
  Index
Susan Blackford
2001-08-19