1 SUBROUTINE pslabrd( M, N, NB, A, IA, JA, DESCA, D, E, TAUQ, TAUP,
2 $ X, IX, JX, DESCX, Y, IY, JY, DESCY, WORK )
10 INTEGER IA, IX, IY, JA, JX, JY, M, N, NB
13 INTEGER DESCA( * ), DESCX( * ), DESCY( * )
14 REAL A( * ), D( * ), E( * ), TAUP( * ),
15 $ tauq( * ), x( * ), y( * ), work( * )
248 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
249 $ lld_, mb_, m_, nb_, n_, rsrc_
250 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
251 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
252 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
254 parameter( one = 1.0e+0, zero = 0.0e+0 )
257 INTEGER I, IACOL, IAROW, ICTXT, II, IPY, IW, J, JJ,
258 $ jwy, k, mycol, myrow, npcol, nprow
260 INTEGER DESCD( DLEN_ ), DESCE( DLEN_ ),
261 $ desctp( dlen_ ), desctq( dlen_ ),
262 $ descw( dlen_ ), descwy( dlen_ )
276 IF( m.LE.0 .OR. n.LE.0 )
279 ictxt = desca( ctxt_ )
280 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
281 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, ii, jj,
283 ipy = desca( mb_ ) + 1
284 iw = mod( ia-1, desca( nb_ ) ) + 1
287 CALL descset( descwy, 1, n+mod( ia-1, descy( nb_ ) ), 1,
288 $ desca( nb_ ), iarow, iacol, ictxt, 1 )
289 CALL descset( descw, desca( mb_ ), 1, desca( mb_ ), 1, iarow,
290 $ iacol, ictxt, desca( mb_ ) )
291 CALL descset( desctq, 1, ja+
min(m,n)-1, 1, desca( nb_ ), iarow,
292 $ desca( csrc_ ), desca( ctxt_ ), 1 )
293 CALL descset( desctp, ia+
min(m,n)-1, 1, desca( mb_ ), 1,
294 $ desca( rsrc_ ), iacol, desca( ctxt_ ),
301 CALL descset( descd, 1, ja+
min(m,n)-1, 1, desca( nb_ ), myrow,
302 $ desca( csrc_ ), desca( ctxt_ ), 1 )
303 CALL descset( desce, ia+
min(m,n)-1, 1, desca( mb_ ), 1,
304 $ desca( rsrc_ ), mycol, desca( ctxt_ ),
314 CALL psgemv(
'No transpose', m-k+1, k-1, -one, a, i, ja,
315 $ desca, y, iy, jy+k-1, descy, 1, one, a, i,
317 CALL psgemv(
'No transpose', m-k+1, k-1, -one, x, ix+k-1,
318 $ jx, descx, a, ia, j, desca, 1, one, a, i, j,
320 CALL pselset( a, i-1, j, desca, alpha )
325 CALL pslarfg( m-k+1, alpha, i, j, a, i+1, j, desca, 1,
327 CALL pselset( d, 1, j, descd, alpha )
328 CALL pselset( a, i, j, desca, one )
332 CALL psgemv(
'Transpose', m-k+1, n-k, one, a, i, j+1, desca,
333 $ a, i, j, desca, 1, zero, work( ipy ), 1, jwy,
334 $ descwy, descwy( m_ ) )
335 CALL psgemv(
'Transpose', m-k+1, k-1, one, a, i, ja, desca,
336 $ a, i, j, desca, 1, zero, work, iw, 1, descw,
338 CALL psgemv(
'Transpose', k-1, n-k, -one, y, iy, jy+k,
339 $ descy, work, iw, 1, descw, 1, one, work( ipy ),
340 $ 1, jwy, descwy, descwy( m_ ) )
341 CALL psgemv(
'Transpose', m-k+1, k-1, one, x, ix+k-1, jx,
342 $ descx, a, i, j, desca, 1, zero, work, iw, 1,
344 CALL psgemv(
'Transpose', k-1, n-k, -one, a, ia, j+1, desca,
345 $ work, iw, 1, descw, 1, one, work( ipy ), 1,
346 $ jwy, descwy, descwy( m_ ) )
348 CALL pselget(
'Rowwise',
' ', tau, tauq, 1, j, desctq )
349 CALL psscal( n-k, tau, work( ipy ), 1, jwy, descwy,
351 CALL pscopy( n-k, work( ipy ), 1, jwy, descwy, descwy( m_ ),
352 $ y, iy+k-1, jy+k, descy, descy( m_ ) )
356 CALL psgemv(
'Transpose', k, n-k, -one, y, iy, jy+k, descy,
357 $ a, i, ja, desca, desca( m_ ), one, a, i, j+1,
358 $ desca, desca( m_ ) )
359 CALL psgemv(
'Transpose', k-1, n-k, -one, a, ia, j+1, desca,
360 $ x, ix+k-1, jx, descx, descx( m_ ), one, a, i,
361 $ j+1, desca, desca( m_ ) )
362 CALL pselset( a, i, j, desca, alpha )
366 CALL pslarfg( n-k, alpha, i, j+1, a, i,
367 $
min( j+2, n+ja-1 ), desca, desca( m_ ), taup )
368 CALL pselset( e, i, 1, desce, alpha )
369 CALL pselset( a, i, j+1, desca, one )
373 CALL psgemv(
'No transpose', m-k, n-k, one, a, i+1, j+1,
374 $ desca, a, i, j+1, desca, desca( m_ ), zero, x,
375 $ ix+k, jx+k-1, descx, 1 )
376 CALL psgemv(
'No transpose', k, n-k, one, y, iy, jy+k,
377 $ descy, a, i, j+1, desca, desca( m_ ), zero,
378 $ work, iw, 1, descw, 1 )
379 CALL psgemv(
'No transpose', m-k, k, -one, a, i+1, ja,
380 $ desca, work, iw, 1, descw, 1, one, x, ix+k,
382 CALL psgemv(
'No transpose', k-1, n-k, one, a, ia, j+1,
383 $ desca, a, i, j+1, desca, desca( m_ ), zero,
384 $ work, iw, 1, descw, 1 )
385 CALL psgemv(
'No transpose', m-k, k-1, -one, x, ix+k, jx,
386 $ descx, work, iw, 1, descw, 1, one, x, ix+k,
389 CALL pselget(
'Columnwise',
' ', tau, taup, i, 1, desctp )
390 CALL psscal( m-k, tau, x, ix+k, jx+k-1, descx, 1 )
397 CALL descset( descd, ia+
min(m,n)-1, 1, desca( mb_ ), 1,
398 $ desca( rsrc_ ), mycol, desca( ctxt_ ),
400 CALL descset( desce, 1, ja+
min(m,n)-1, 1, desca( nb_ ), myrow,
401 $ desca( csrc_ ), desca( ctxt_ ), 1 )
410 CALL psgemv(
'Transpose', k-1, n-k+1, -one, y, iy,
411 $ jy+k-1, descy, a, i, ja, desca, desca( m_ ),
412 $ one, a, i, j, desca, desca( m_ ) )
413 CALL psgemv(
'Transpose', k-1, n-k+1, -one, a, ia, j,
414 $ desca, x, ix+k-1, jx, descx, descx( m_ ),
415 $ one, a, i, j, desca, desca( m_ ) )
416 CALL pselset( a, i, j-1, desca, alpha )
421 CALL pslarfg( n-k+1, alpha, i, j, a, i, j+1, desca,
422 $ desca( m_ ), taup )
423 CALL pselset( d, i, 1, descd, alpha )
424 CALL pselset( a, i, j, desca, one )
428 CALL psgemv(
'No transpose', m-k, n-k+1, one, a, i+1, j,
429 $ desca, a, i, j, desca, desca( m_ ), zero, x,
430 $ ix+k, jx+k-1, descx, 1 )
431 CALL psgemv(
'No transpose', k-1, n-k+1, one, y, iy, jy+k-1,
432 $ descy, a, i, j, desca, desca( m_ ), zero,
433 $ work, iw, 1, descw, 1 )
434 CALL psgemv(
'No transpose', m-k, k-1, -one, a, i+1, ja,
435 $ desca, work, iw, 1, descw, 1, one, x, ix+k,
437 CALL psgemv(
'No transpose', k-1, n-k+1, one, a, ia, j,
438 $ desca, a, i, j, desca, desca( m_ ), zero,
439 $ work, iw, 1, descw, 1 )
440 CALL psgemv(
'No transpose', m-k, k-1, -one, x, ix+k, jx,
441 $ descx, work, iw, 1, descw, 1, one, x, ix+k,
444 CALL pselget(
'Columnwise',
' ', tau, taup, i, 1, desctp )
445 CALL psscal( m-k, tau, x, ix+k, jx+k-1, descx, 1 )
449 CALL psgemv(
'No transpose', m-k, k-1, -one, a, i+1, ja,
450 $ desca, y, iy, jy+k-1, descy, 1, one, a, i+1, j,
452 CALL psgemv(
'No transpose', m-k, k, -one, x, ix+k, jx,
453 $ descx, a, ia, j, desca, 1, one, a, i+1, j,
455 CALL pselset( a, i, j, desca, alpha )
459 CALL pslarfg( m-k, alpha, i+1, j, a,
min( i+2, m+ia-1 ),
460 $ j, desca, 1, tauq )
461 CALL pselset( e, 1, j, desce, alpha )
462 CALL pselset( a, i+1, j, desca, one )
466 CALL psgemv(
'Transpose', m-k, n-k, one, a, i+1, j+1, desca,
467 $ a, i+1, j, desca, 1, zero, work( ipy ), 1,
468 $ jwy, descwy, descwy( m_ ) )
469 CALL psgemv(
'Transpose', m-k, k-1, one, a, i+1, ja, desca,
470 $ a, i+1, j, desca, 1, zero, work, iw, 1, descw,
472 CALL psgemv(
'Transpose', k-1, n-k, -one, y, iy, jy+k,
473 $ descy, work, iw, 1, descw, 1, one, work( ipy ),
474 $ 1, jwy, descwy, descwy( m_ ) )
475 CALL psgemv(
'Transpose', m-k, k, one, x, ix+k, jx, descx,
476 $ a, i+1, j, desca, 1, zero, work, iw, 1, descw,
478 CALL psgemv(
'Transpose', k, n-k, -one, a, ia, j+1, desca,
479 $ work, iw, 1, descw, 1, one, work( ipy ), 1,
480 $ jwy, descwy, descwy( m_ ) )
482 CALL pselget(
'Rowwise',
' ', tau, tauq, 1, j, desctq )
483 CALL psscal( n-k, tau, work( ipy ), 1, jwy, descwy,
485 CALL pscopy( n-k, work( ipy ), 1, jwy, descwy, descwy( m_ ),
486 $ y, iy+k-1, jy+k, descy, descy( m_ ) )