00001 SUBROUTINE DSYGST( ITYPE, UPLO, N, A, LDA, B, LDB, INFO )
00002
00003
00004
00005
00006
00007
00008
00009 CHARACTER UPLO
00010 INTEGER INFO, ITYPE, LDA, LDB, N
00011
00012
00013 DOUBLE PRECISION A( LDA, * ), B( LDB, * )
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 DOUBLE PRECISION ONE, HALF
00076 PARAMETER ( ONE = 1.0D0, HALF = 0.5D0 )
00077
00078
00079 LOGICAL UPPER
00080 INTEGER K, KB, NB
00081
00082
00083 EXTERNAL DSYGS2, DSYMM, DSYR2K, DTRMM, DTRSM, XERBLA
00084
00085
00086 INTRINSIC MAX, MIN
00087
00088
00089 LOGICAL LSAME
00090 INTEGER ILAENV
00091 EXTERNAL LSAME, ILAENV
00092
00093
00094
00095
00096
00097 INFO = 0
00098 UPPER = LSAME( UPLO, 'U' )
00099 IF( ITYPE.LT.1 .OR. ITYPE.GT.3 ) THEN
00100 INFO = -1
00101 ELSE IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
00102 INFO = -2
00103 ELSE IF( N.LT.0 ) THEN
00104 INFO = -3
00105 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
00106 INFO = -5
00107 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
00108 INFO = -7
00109 END IF
00110 IF( INFO.NE.0 ) THEN
00111 CALL XERBLA( 'DSYGST', -INFO )
00112 RETURN
00113 END IF
00114
00115
00116
00117 IF( N.EQ.0 )
00118 $ RETURN
00119
00120
00121
00122 NB = ILAENV( 1, 'DSYGST', UPLO, N, -1, -1, -1 )
00123
00124 IF( NB.LE.1 .OR. NB.GE.N ) THEN
00125
00126
00127
00128 CALL DSYGS2( ITYPE, UPLO, N, A, LDA, B, LDB, INFO )
00129 ELSE
00130
00131
00132
00133 IF( ITYPE.EQ.1 ) THEN
00134 IF( UPPER ) THEN
00135
00136
00137
00138 DO 10 K = 1, N, NB
00139 KB = MIN( N-K+1, NB )
00140
00141
00142
00143 CALL DSYGS2( ITYPE, UPLO, KB, A( K, K ), LDA,
00144 $ B( K, K ), LDB, INFO )
00145 IF( K+KB.LE.N ) THEN
00146 CALL DTRSM( 'Left', UPLO, 'Transpose', 'Non-unit',
00147 $ KB, N-K-KB+1, ONE, B( K, K ), LDB,
00148 $ A( K, K+KB ), LDA )
00149 CALL DSYMM( 'Left', UPLO, KB, N-K-KB+1, -HALF,
00150 $ A( K, K ), LDA, B( K, K+KB ), LDB, ONE,
00151 $ A( K, K+KB ), LDA )
00152 CALL DSYR2K( UPLO, 'Transpose', N-K-KB+1, KB, -ONE,
00153 $ A( K, K+KB ), LDA, B( K, K+KB ), LDB,
00154 $ ONE, A( K+KB, K+KB ), LDA )
00155 CALL DSYMM( 'Left', UPLO, KB, N-K-KB+1, -HALF,
00156 $ A( K, K ), LDA, B( K, K+KB ), LDB, ONE,
00157 $ A( K, K+KB ), LDA )
00158 CALL DTRSM( 'Right', UPLO, 'No transpose',
00159 $ 'Non-unit', KB, N-K-KB+1, ONE,
00160 $ B( K+KB, K+KB ), LDB, A( K, K+KB ),
00161 $ LDA )
00162 END IF
00163 10 CONTINUE
00164 ELSE
00165
00166
00167
00168 DO 20 K = 1, N, NB
00169 KB = MIN( N-K+1, NB )
00170
00171
00172
00173 CALL DSYGS2( ITYPE, UPLO, KB, A( K, K ), LDA,
00174 $ B( K, K ), LDB, INFO )
00175 IF( K+KB.LE.N ) THEN
00176 CALL DTRSM( 'Right', UPLO, 'Transpose', 'Non-unit',
00177 $ N-K-KB+1, KB, ONE, B( K, K ), LDB,
00178 $ A( K+KB, K ), LDA )
00179 CALL DSYMM( 'Right', UPLO, N-K-KB+1, KB, -HALF,
00180 $ A( K, K ), LDA, B( K+KB, K ), LDB, ONE,
00181 $ A( K+KB, K ), LDA )
00182 CALL DSYR2K( UPLO, 'No transpose', N-K-KB+1, KB,
00183 $ -ONE, A( K+KB, K ), LDA, B( K+KB, K ),
00184 $ LDB, ONE, A( K+KB, K+KB ), LDA )
00185 CALL DSYMM( 'Right', UPLO, N-K-KB+1, KB, -HALF,
00186 $ A( K, K ), LDA, B( K+KB, K ), LDB, ONE,
00187 $ A( K+KB, K ), LDA )
00188 CALL DTRSM( 'Left', UPLO, 'No transpose',
00189 $ 'Non-unit', N-K-KB+1, KB, ONE,
00190 $ B( K+KB, K+KB ), LDB, A( K+KB, K ),
00191 $ LDA )
00192 END IF
00193 20 CONTINUE
00194 END IF
00195 ELSE
00196 IF( UPPER ) THEN
00197
00198
00199
00200 DO 30 K = 1, N, NB
00201 KB = MIN( N-K+1, NB )
00202
00203
00204
00205 CALL DTRMM( 'Left', UPLO, 'No transpose', 'Non-unit',
00206 $ K-1, KB, ONE, B, LDB, A( 1, K ), LDA )
00207 CALL DSYMM( 'Right', UPLO, K-1, KB, HALF, A( K, K ),
00208 $ LDA, B( 1, K ), LDB, ONE, A( 1, K ), LDA )
00209 CALL DSYR2K( UPLO, 'No transpose', K-1, KB, ONE,
00210 $ A( 1, K ), LDA, B( 1, K ), LDB, ONE, A,
00211 $ LDA )
00212 CALL DSYMM( 'Right', UPLO, K-1, KB, HALF, A( K, K ),
00213 $ LDA, B( 1, K ), LDB, ONE, A( 1, K ), LDA )
00214 CALL DTRMM( 'Right', UPLO, 'Transpose', 'Non-unit',
00215 $ K-1, KB, ONE, B( K, K ), LDB, A( 1, K ),
00216 $ LDA )
00217 CALL DSYGS2( ITYPE, UPLO, KB, A( K, K ), LDA,
00218 $ B( K, K ), LDB, INFO )
00219 30 CONTINUE
00220 ELSE
00221
00222
00223
00224 DO 40 K = 1, N, NB
00225 KB = MIN( N-K+1, NB )
00226
00227
00228
00229 CALL DTRMM( 'Right', UPLO, 'No transpose', 'Non-unit',
00230 $ KB, K-1, ONE, B, LDB, A( K, 1 ), LDA )
00231 CALL DSYMM( 'Left', UPLO, KB, K-1, HALF, A( K, K ),
00232 $ LDA, B( K, 1 ), LDB, ONE, A( K, 1 ), LDA )
00233 CALL DSYR2K( UPLO, 'Transpose', K-1, KB, ONE,
00234 $ A( K, 1 ), LDA, B( K, 1 ), LDB, ONE, A,
00235 $ LDA )
00236 CALL DSYMM( 'Left', UPLO, KB, K-1, HALF, A( K, K ),
00237 $ LDA, B( K, 1 ), LDB, ONE, A( K, 1 ), LDA )
00238 CALL DTRMM( 'Left', UPLO, 'Transpose', 'Non-unit', KB,
00239 $ K-1, ONE, B( K, K ), LDB, A( K, 1 ), LDA )
00240 CALL DSYGS2( ITYPE, UPLO, KB, A( K, K ), LDA,
00241 $ B( K, K ), LDB, INFO )
00242 40 CONTINUE
00243 END IF
00244 END IF
00245 END IF
00246 RETURN
00247
00248
00249
00250 END