comparison libcruft/lapack/spttrs.f @ 7789:82be108cc558

First attempt at single precision tyeps * * * corrections to qrupdate single precision routines * * * prefer demotion to single over promotion to double * * * Add single precision support to log2 function * * * Trivial PROJECT file update * * * Cache optimized hermitian/transpose methods * * * Add tests for tranpose/hermitian and ChangeLog entry for new transpose code
author David Bateman <dbateman@free.fr>
date Sun, 27 Apr 2008 22:34:17 +0200
parents
children
comparison
equal deleted inserted replaced
7788:45f5faba05a2 7789:82be108cc558
1 SUBROUTINE SPTTRS( N, NRHS, D, E, B, LDB, INFO )
2 *
3 * -- LAPACK routine (version 3.1) --
4 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
5 * November 2006
6 *
7 * .. Scalar Arguments ..
8 INTEGER INFO, LDB, N, NRHS
9 * ..
10 * .. Array Arguments ..
11 REAL B( LDB, * ), D( * ), E( * )
12 * ..
13 *
14 * Purpose
15 * =======
16 *
17 * SPTTRS solves a tridiagonal system of the form
18 * A * X = B
19 * using the L*D*L' factorization of A computed by SPTTRF. D is a
20 * diagonal matrix specified in the vector D, L is a unit bidiagonal
21 * matrix whose subdiagonal is specified in the vector E, and X and B
22 * are N by NRHS matrices.
23 *
24 * Arguments
25 * =========
26 *
27 * N (input) INTEGER
28 * The order of the tridiagonal matrix A. N >= 0.
29 *
30 * NRHS (input) INTEGER
31 * The number of right hand sides, i.e., the number of columns
32 * of the matrix B. NRHS >= 0.
33 *
34 * D (input) REAL array, dimension (N)
35 * The n diagonal elements of the diagonal matrix D from the
36 * L*D*L' factorization of A.
37 *
38 * E (input) REAL array, dimension (N-1)
39 * The (n-1) subdiagonal elements of the unit bidiagonal factor
40 * L from the L*D*L' factorization of A. E can also be regarded
41 * as the superdiagonal of the unit bidiagonal factor U from the
42 * factorization A = U'*D*U.
43 *
44 * B (input/output) REAL array, dimension (LDB,NRHS)
45 * On entry, the right hand side vectors B for the system of
46 * linear equations.
47 * On exit, the solution vectors, X.
48 *
49 * LDB (input) INTEGER
50 * The leading dimension of the array B. LDB >= max(1,N).
51 *
52 * INFO (output) INTEGER
53 * = 0: successful exit
54 * < 0: if INFO = -k, the k-th argument had an illegal value
55 *
56 * =====================================================================
57 *
58 * .. Local Scalars ..
59 INTEGER J, JB, NB
60 * ..
61 * .. External Functions ..
62 INTEGER ILAENV
63 EXTERNAL ILAENV
64 * ..
65 * .. External Subroutines ..
66 EXTERNAL SPTTS2, XERBLA
67 * ..
68 * .. Intrinsic Functions ..
69 INTRINSIC MAX, MIN
70 * ..
71 * .. Executable Statements ..
72 *
73 * Test the input arguments.
74 *
75 INFO = 0
76 IF( N.LT.0 ) THEN
77 INFO = -1
78 ELSE IF( NRHS.LT.0 ) THEN
79 INFO = -2
80 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
81 INFO = -6
82 END IF
83 IF( INFO.NE.0 ) THEN
84 CALL XERBLA( 'SPTTRS', -INFO )
85 RETURN
86 END IF
87 *
88 * Quick return if possible
89 *
90 IF( N.EQ.0 .OR. NRHS.EQ.0 )
91 $ RETURN
92 *
93 * Determine the number of right-hand sides to solve at a time.
94 *
95 IF( NRHS.EQ.1 ) THEN
96 NB = 1
97 ELSE
98 NB = MAX( 1, ILAENV( 1, 'SPTTRS', ' ', N, NRHS, -1, -1 ) )
99 END IF
100 *
101 IF( NB.GE.NRHS ) THEN
102 CALL SPTTS2( N, NRHS, D, E, B, LDB )
103 ELSE
104 DO 10 J = 1, NRHS, NB
105 JB = MIN( NRHS-J+1, NB )
106 CALL SPTTS2( N, JB, D, E, B( 1, J ), LDB )
107 10 CONTINUE
108 END IF
109 *
110 RETURN
111 *
112 * End of SPTTRS
113 *
114 END