1STPTRI(1) LAPACK routine (version 3.1) STPTRI(1)
2
3
4
6 STPTRI - the inverse of a real upper or lower triangular matrix A
7 stored in packed format
8
10 SUBROUTINE STPTRI( UPLO, DIAG, N, AP, INFO )
11
12 CHARACTER DIAG, UPLO
13
14 INTEGER INFO, N
15
16 REAL AP( * )
17
19 STPTRI computes the inverse of a real upper or lower triangular matrix
20 A stored in packed format.
21
22
24 UPLO (input) CHARACTER*1
25 = 'U': A is upper triangular;
26 = 'L': A is lower triangular.
27
28 DIAG (input) CHARACTER*1
29 = 'N': A is non-unit triangular;
30 = 'U': A is unit triangular.
31
32 N (input) INTEGER
33 The order of the matrix A. N >= 0.
34
35 AP (input/output) REAL array, dimension (N*(N+1)/2)
36 On entry, the upper or lower triangular matrix A, stored colum‐
37 nwise in a linear array. The j-th column of A is stored in the
38 array AP as follows: if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j)
39 for 1<=i<=j; if UPLO = 'L', AP(i + (j-1)*((2*n-j)/2) = A(i,j)
40 for j<=i<=n. See below for further details. On exit, the
41 (triangular) inverse of the original matrix, in the same packed
42 storage format.
43
44 INFO (output) INTEGER
45 = 0: successful exit
46 < 0: if INFO = -i, the i-th argument had an illegal value
47 > 0: if INFO = i, A(i,i) is exactly zero. The triangular
48 matrix is singular and its inverse can not be computed.
49
51 A triangular matrix A can be transferred to packed storage using one of
52 the following program segments:
53
54 UPLO = 'U': UPLO = 'L':
55
56 JC = 1 JC = 1
57 DO 2 J = 1, N DO 2 J = 1, N
58 DO 1 I = 1, J DO 1 I = J, N
59 AP(JC+I-1) = A(I,J) AP(JC+I-J) = A(I,J)
60 1 CONTINUE 1 CONTINUE
61 JC = JC + J JC = JC + N - J + 1
62 2 CONTINUE 2 CONTINUE
63
64
65
66
67 LAPACK routine (version 3.1) November 2006 STPTRI(1)