1 SUBROUTINE psstedc( COMPZ, N, D, E, Q, IQ, JQ, DESCQ, WORK, LWORK,
2 $ IWORK, LIWORK, INFO )
11 INTEGER INFO, IQ, JQ, LIWORK, LWORK, N
14 INTEGER DESCQ( * ), IWORK( * )
15 REAL D( * ), E( * ), Q( * ), WORK( * )
120 INTEGER BLOCK_CYCLIC_2D, DLEN_, DTYPE_, CTXT_, M_, N_,
121 $ mb_, nb_, rsrc_, csrc_, lld_
122 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
123 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
124 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
126 parameter( zero = 0.0e+0, one = 1.0e+0 )
130 INTEGER ICOFFQ, IIQ, IPQ, IQCOL, IQROW, IROFFQ, JJQ,
131 $ ldq, liwmin, lwmin, mycol, myrow, nb, np,
137 INTEGER INDXG2P, NUMROC
139 EXTERNAL indxg2p, lsame, numroc, slanst
151 IF( block_cyclic_2d*csrc_*ctxt_*dlen_*dtype_*lld_*mb_*m_*nb_*n_*
156 CALL blacs_gridinfo( descq( ctxt_ ), nprow, npcol, myrow, mycol )
159 np = numroc( n, nb, myrow, descq( rsrc_ ), nprow )
160 nq = numroc( n, nb, mycol, descq( csrc_ ), npcol )
162 IF( nprow.EQ.-1 )
THEN
163 info = -( 600+ctxt_ )
165 CALL chk1mat( n, 2, n, 2, iq, jq, descq, 8, info )
168 iroffq = mod( iq-1, descq( mb_ ) )
169 icoffq = mod( jq-1, descq( nb_ ) )
170 iqrow = indxg2p( iq, nb, myrow, descq( rsrc_ ), nprow )
171 iqcol = indxg2p( jq, nb, mycol, descq( csrc_ ), npcol )
172 lwmin = 6*n + 2*np*nq
173 liwmin = 2 + 7*n + 8*npcol
174 work( 1 ) = real( lwmin )
176 lquery = ( lwork.EQ.-1 .OR. liwork.EQ.-1 )
177 IF( .NOT.lsame( compz,
'I' ) )
THEN
179 ELSE IF( n.LT.0 )
THEN
181 ELSE IF( iroffq.NE.icoffq .OR. icoffq.NE.0 )
THEN
183 ELSE IF( descq( mb_ ).NE.descq( nb_ ) )
THEN
185 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
187 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
193 CALL pxerbla( descq( ctxt_ ),
'PSSTEDC', -info )
195 ELSE IF( lquery )
THEN
203 CALL infog2l( iq, jq, descq, nprow, npcol, myrow, mycol, iiq, jjq,
206 IF( myrow.EQ.iqrow .AND. mycol.EQ.iqcol )
216 IF( ( myrow.EQ.iqrow ) .AND. ( mycol.EQ.iqcol ) )
THEN
217 ipq = iiq + ( jjq-1 )*ldq
218 CALL sstedc(
'I', n, d, e, q( ipq ), ldq, work, lwork,
219 $ iwork, liwork, info )
230 IF( npcol*nprow.EQ.1 )
THEN
231 ipq = iiq + ( jjq-1 )*ldq
232 CALL sstedc(
'I', n, d, e, q( ipq ), ldq, work, lwork, iwork,
239 orgnrm = slanst(
'M', n, d, e )
240 IF( orgnrm.NE.zero )
THEN
241 CALL slascl(
'G', 0, 0, orgnrm, one, n, 1, d, n, info )
242 CALL slascl(
'G', 0, 0, orgnrm, one, n-1, 1, e, n-1, info )
245 CALL pslaed0( n, d, e, q, iq, jq, descq, work, iwork, info )
249 CALL pslasrt(
'I', n, d, q, iq, jq, descq, work, lwork, iwork,
255 $
CALL slascl(
'G', 0, 0, one, orgnrm, n, 1, d, n, info )
260 $ work( 1 ) = real( lwmin )
262 $ iwork( 1 ) = liwmin