1
SUBROUTINE SB04NW( ABSCHR, UL, N, M, C, LDC, INDX, AB, LDAB, D )
3
C RELEASE 4.0, WGS COPYRIGHT 1999.
7
C To construct the right-hand side D for a system of equations in
8
C Hessenberg form solved via SB04NY (case with 1 right-hand side).
15
C Indicates whether AB contains A or B, as follows:
16
C = 'A': AB contains A;
17
C = 'B': AB contains B.
20
C Indicates whether AB is upper or lower Hessenberg matrix,
22
C = 'U': AB is upper Hessenberg;
23
C = 'L': AB is lower Hessenberg.
25
C Input/Output Parameters
28
C The order of the matrix A. N >= 0.
31
C The order of the matrix B. M >= 0.
33
C C (input) DOUBLE PRECISION array, dimension (LDC,M)
34
C The leading N-by-M part of this array must contain both
35
C the not yet modified part of the coefficient matrix C of
36
C the Sylvester equation AX + XB = C, and both the currently
37
C computed part of the solution of the Sylvester equation.
40
C The leading dimension of array C. LDC >= MAX(1,N).
42
C INDX (input) INTEGER
43
C The position of the column/row of C to be used in the
44
C construction of the right-hand side D.
46
C AB (input) DOUBLE PRECISION array, dimension (LDAB,*)
47
C The leading N-by-N or M-by-M part of this array must
48
C contain either A or B of the Sylvester equation
52
C The leading dimension of array AB.
53
C LDAB >= MAX(1,N) or LDAB >= MAX(1,M) (depending on
54
C ABSCHR = 'A' or ABSCHR = 'B', respectively).
56
C D (output) DOUBLE PRECISION array, dimension (*)
57
C The leading N or M part of this array (depending on
58
C ABSCHR = 'B' or ABSCHR = 'A', respectively) contains the
67
C Release 3.0: V. Sima, Katholieke Univ. Leuven, Belgium, Aug. 1997.
68
C Supersedes Release 2.0 routine SB04BW by M. Vanbegin, and
69
C P. Van Dooren, Philips Research Laboratory, Brussels, Belgium.
77
C Hessenberg form, orthogonal transformation, real Schur form,
80
C ******************************************************************
84
PARAMETER ( ONE = 1.0D0 )
85
C .. Scalar Arguments ..
87
INTEGER INDX, LDAB, LDC, M, N
88
C .. Array Arguments ..
89
DOUBLE PRECISION AB(LDAB,*), C(LDC,*), D(*)
90
C .. External Functions ..
93
C .. External Subroutines ..
95
C .. Executable Statements ..
97
C For speed, no tests on the input scalar arguments are made.
98
C Quick return if possible.
100
IF ( N.EQ.0 .OR. M.EQ.0 )
103
IF ( LSAME( ABSCHR, 'B' ) ) THEN
105
C Construct the column of the right-hand side.
107
CALL DCOPY( N, C(1,INDX), 1, D, 1 )
108
IF ( LSAME( UL, 'U' ) ) THEN
109
IF ( INDX.GT.1 ) THEN
110
CALL DGEMV( 'N', N, INDX-1, -ONE, C, LDC, AB(1,INDX), 1,
114
IF ( INDX.LT.M ) THEN
115
CALL DGEMV( 'N', N, M-INDX, -ONE, C(1,INDX+1), LDC,
116
$ AB(INDX+1,INDX), 1, ONE, D, 1 )
121
C Construct the row of the right-hand side.
123
CALL DCOPY( M, C(INDX,1), LDC, D, 1 )
124
IF ( LSAME( UL, 'U' ) ) THEN
125
IF ( INDX.LT.N ) THEN
126
CALL DGEMV( 'T', N-INDX, M, -ONE, C(INDX+1,1), LDC,
127
$ AB(INDX,INDX+1), LDAB, ONE, D, 1 )
130
IF ( INDX.GT.1 ) THEN
131
CALL DGEMV( 'T', INDX-1, M, -ONE, C, LDC, AB(INDX,1),
138
C *** Last line of SB04NW ***