1 SUBROUTINE pzget22( TRANSA, TRANSE, TRANSW, N, A, DESCA, E, DESCE,
2 $ W, WORK, DESCW, RWORK, RESULT )
10 CHARACTER TRANSA, TRANSE, TRANSW
14 INTEGER DESCA( * ), DESCE( * ), DESCW( * )
15 DOUBLE PRECISION RESULT( 2 ), RWORK( * )
16 COMPLEX*16 A( * ), E( * ), W( * ), WORK( * )
93 INTEGER BLOCK_CYCLIC_2D, DLEN_, DTYPE_, CTXT_, M_, N_,
94 $ mb_, nb_, rsrc_, csrc_, lld_
95 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
96 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
97 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
98 DOUBLE PRECISION ZERO, ONE
99 parameter( zero = 0.0d+0, one = 1.0d+0 )
100 COMPLEX*16 CZERO, CONE
101 parameter( czero = ( 0.0d+0, 0.0d+0 ),
102 $ cone = ( 1.0d+0, 0.0d+0 ) )
105 CHARACTER NORMA, NORME
106 INTEGER ICOL, II, IROW, ITRNSE, ITRNSW, J, JCOL, JJ,
107 $ jrow, jvec, lda, lde, ldw, mb, mycol, myrow,
108 $ nb, npcol, nprow, contxt, ca, csrc, ra, rsrc
109 DOUBLE PRECISION ANORM, ENORM, ENRMAX, ENRMIN, ERRNRM, TEMP1,
111 COMPLEX*16 CDUM, WTEMP
115 DOUBLE PRECISION PDLAMCH, PZLANGE
116 EXTERNAL lsame, pdlamch, pzlange
119 EXTERNAL blacs_gridinfo, dgamn2d, dgamx2d,
infog2l,
123 INTRINSIC abs, dble, dconjg, dimag,
max,
min
126 DOUBLE PRECISION CABS1
129 cabs1( cdum ) = abs( dble( cdum ) ) + abs( dimag( cdum ) )
140 contxt = desca( ctxt_ )
141 rsrc = desca( rsrc_ )
142 csrc = desca( csrc_ )
148 CALL blacs_gridinfo( contxt, nprow, npcol, myrow, mycol )
150 unfl = pdlamch( contxt,
'Safe minimum' )
151 ulp = pdlamch( contxt,
'Precision' )
158 IF( lsame( transa,
'T' ) .OR. lsame( transa,
'C' ) )
THEN
162 IF( lsame( transe,
'T' ) )
THEN
165 ELSE IF( lsame( transe,
'C' ) )
THEN
170 IF( lsame( transw,
'C' ) )
THEN
178 IF( itrnse.EQ.0 )
THEN
182 CALL infog2l( j, jvec, desce, nprow, npcol, myrow, mycol,
183 $ irow, icol, ii, jj )
184 IF( ( myrow.EQ.ii ) .AND. ( mycol.EQ.jj ) )
THEN
185 temp1 =
max( temp1, cabs1( e( ( icol-1 )*lde+
189 IF( mycol.EQ.jj )
THEN
190 CALL dgamx2d( contxt,
'Col',
' ', 1, 1, temp1, 1, ra, ca,
192 enrmin =
min( enrmin, temp1 )
193 enrmax =
max( enrmax, temp1 )
196 CALL dgamx2d( contxt,
'Row',
' ', 1, 1, enrmax, 1, ra, ca, -1,
198 CALL dgamn2d( contxt,
'Row',
' ', 1, 1, enrmin, 1, ra, ca, -1,
204 CALL infog2l( j, jvec, desce, nprow, npcol, myrow, mycol,
205 $ irow, icol, ii, jj )
206 IF( ( myrow.EQ.ii ) .AND. ( mycol.EQ.jj ) )
THEN
207 temp1 =
max( temp1, cabs1( e( ( icol-1 )*lde+
211 IF( myrow.EQ.ii )
THEN
212 CALL dgamx2d( contxt,
'Row',
' ', 1, 1, temp1, 1, ra, ca,
214 enrmin =
min( enrmin, temp1 )
215 enrmax =
max( enrmax, temp1 )
218 CALL dgamx2d( contxt,
'Row',
' ', 1, 1, enrmax, 1, ra, ca, -1,
220 CALL dgamn2d( contxt,
'Row',
' ', 1, 1, enrmin, 1, ra, ca, -1,
226 anorm =
max( pzlange( norma, n, n, a, 1, 1, desca, rwork ), unfl )
230 enorm =
max( pzlange( norme, n, n, e, 1, 1, desce, rwork ), ulp )
236 CALL pzlaset(
'Full', n, n, czero, czero, work, 1, 1, descw )
239 IF( itrnsw.EQ.0 )
THEN
242 wtemp = dconjg( w( jcol ) )
245 IF( itrnse.EQ.0 )
THEN
246 CALL pzaxpy( n, wtemp, e, 1, jcol, desce, 1, work, 1, jcol,
248 ELSE IF( itrnse.EQ.1 )
THEN
249 CALL pzaxpy( n, wtemp, e, jcol, 1, desce, n, work, 1, jcol,
252 CALL pzaxpy( n, dconjg( wtemp ), e, jcol, 1, desce, n, work,
253 $ 1, jcol, descw, 1 )
255 CALL infog2l( jrow, jcol, descw, nprow, npcol, myrow,
256 $ mycol, irow, icol, ii, jj )
257 IF( ( myrow.EQ.ii ) .AND. ( mycol.EQ.jj ) )
THEN
258 work( ( jcol-1 )*ldw+jrow )
259 $ = dconjg( work( ( jcol-1 )*ldw+jrow ) )
265 CALL pzgemm( transa, transe, n, n, n, cone, a, 1, 1, desca, e, 1,
266 $ 1, desce, -cone, work, 1, 1, descw )
268 errnrm = pzlange(
'One', n, n, work, 1, 1, descw, rwork ) / enorm
272 IF( anorm.GT.errnrm )
THEN
273 result( 1 ) = ( errnrm / anorm ) / ulp
275 IF( anorm.LT.one )
THEN
276 result( 1 ) = (
min( errnrm, anorm ) / anorm ) / ulp
278 result( 1 ) =
min( errnrm / anorm, one ) / ulp
284 result( 2 ) =
max( abs( enrmax-one ), abs( enrmin-one ) ) /