ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
pzsyr2k_.c
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------
2 *
3 * -- PBLAS routine (version 2.0) --
4 * University of Tennessee, Knoxville, Oak Ridge National Laboratory,
5 * and University of California, Berkeley.
6 * April 1, 1998
7 *
8 * ---------------------------------------------------------------------
9 */
10 /*
11 * Include files
12 */
13 #include "pblas.h"
14 #include "PBpblas.h"
15 #include "PBtools.h"
16 #include "PBblacs.h"
17 #include "PBblas.h"
18 
19 #ifdef __STDC__
20 void pzsyr2k_( F_CHAR_T UPLO, F_CHAR_T TRANS, int * N, int * K,
21  double * ALPHA,
22  double * A, int * IA, int * JA, int * DESCA,
23  double * B, int * IB, int * JB, int * DESCB,
24  double * BETA,
25  double * C, int * IC, int * JC, int * DESCC )
26 #else
27 void pzsyr2k_( UPLO, TRANS, N, K, ALPHA, A, IA, JA, DESCA,
28  B, IB, JB, DESCB, BETA, C, IC, JC, DESCC )
29 /*
30 * .. Scalar Arguments ..
31 */
32  F_CHAR_T TRANS, UPLO;
33  int * IA, * IB, * IC, * JA, * JB, * JC, * K, * N;
34  double * ALPHA, * BETA;
35 /*
36 * .. Array Arguments ..
37 */
38  int * DESCA, * DESCB, * DESCC;
39  double * A, * B, * C;
40 #endif
41 {
42 /*
43 * Purpose
44 * =======
45 *
46 * PZSYR2K performs one of the symmetric rank 2k operations
47 *
48 * sub( C ) := alpha*sub( A )*sub( B )' + alpha*sub( B )*sub( A )' +
49 * beta*sub( C ),
50 *
51 * or
52 *
53 * sub( C ) := alpha*sub( A )'*sub( B ) + alpha*sub( B )'*sub( A ) +
54 * beta*sub( C ),
55 *
56 * where
57 *
58 * sub( C ) denotes C(IC:IC+N-1,JC:JC+N-1),
59 *
60 * sub( A ) denotes A(IA:IA+N-1,JA:JA+K-1) if TRANS = 'N',
61 * A(IA:IA+K-1,JA:JA+N-1) otherwise, and,
62 *
63 * sub( B ) denotes B(IB:IB+N-1,JB:JB+K-1) if TRANS = 'N',
64 * B(IB:IB+K-1,JB:JB+N-1) otherwise.
65 *
66 * Alpha and beta are scalars, sub( C ) is an n by n symmetric
67 * submatrix and sub( A ) and sub( B ) are n by k submatrices in the
68 * first case and k by n submatrices in the second case.
69 *
70 * Notes
71 * =====
72 *
73 * A description vector is associated with each 2D block-cyclicly dis-
74 * tributed matrix. This vector stores the information required to
75 * establish the mapping between a matrix entry and its corresponding
76 * process and memory location.
77 *
78 * In the following comments, the character _ should be read as
79 * "of the distributed matrix". Let A be a generic term for any 2D
80 * block cyclicly distributed matrix. Its description vector is DESC_A:
81 *
82 * NOTATION STORED IN EXPLANATION
83 * ---------------- --------------- ------------------------------------
84 * DTYPE_A (global) DESCA[ DTYPE_ ] The descriptor type.
85 * CTXT_A (global) DESCA[ CTXT_ ] The BLACS context handle, indicating
86 * the NPROW x NPCOL BLACS process grid
87 * A is distributed over. The context
88 * itself is global, but the handle
89 * (the integer value) may vary.
90 * M_A (global) DESCA[ M_ ] The number of rows in the distribu-
91 * ted matrix A, M_A >= 0.
92 * N_A (global) DESCA[ N_ ] The number of columns in the distri-
93 * buted matrix A, N_A >= 0.
94 * IMB_A (global) DESCA[ IMB_ ] The number of rows of the upper left
95 * block of the matrix A, IMB_A > 0.
96 * INB_A (global) DESCA[ INB_ ] The number of columns of the upper
97 * left block of the matrix A,
98 * INB_A > 0.
99 * MB_A (global) DESCA[ MB_ ] The blocking factor used to distri-
100 * bute the last M_A-IMB_A rows of A,
101 * MB_A > 0.
102 * NB_A (global) DESCA[ NB_ ] The blocking factor used to distri-
103 * bute the last N_A-INB_A columns of
104 * A, NB_A > 0.
105 * RSRC_A (global) DESCA[ RSRC_ ] The process row over which the first
106 * row of the matrix A is distributed,
107 * NPROW > RSRC_A >= 0.
108 * CSRC_A (global) DESCA[ CSRC_ ] The process column over which the
109 * first column of A is distributed.
110 * NPCOL > CSRC_A >= 0.
111 * LLD_A (local) DESCA[ LLD_ ] The leading dimension of the local
112 * array storing the local blocks of
113 * the distributed matrix A,
114 * IF( Lc( 1, N_A ) > 0 )
115 * LLD_A >= MAX( 1, Lr( 1, M_A ) )
116 * ELSE
117 * LLD_A >= 1.
118 *
119 * Let K be the number of rows of a matrix A starting at the global in-
120 * dex IA,i.e, A( IA:IA+K-1, : ). Lr( IA, K ) denotes the number of rows
121 * that the process of row coordinate MYROW ( 0 <= MYROW < NPROW ) would
122 * receive if these K rows were distributed over NPROW processes. If K
123 * is the number of columns of a matrix A starting at the global index
124 * JA, i.e, A( :, JA:JA+K-1, : ), Lc( JA, K ) denotes the number of co-
125 * lumns that the process MYCOL ( 0 <= MYCOL < NPCOL ) would receive if
126 * these K columns were distributed over NPCOL processes.
127 *
128 * The values of Lr() and Lc() may be determined via a call to the func-
129 * tion PB_Cnumroc:
130 * Lr( IA, K ) = PB_Cnumroc( K, IA, IMB_A, MB_A, MYROW, RSRC_A, NPROW )
131 * Lc( JA, K ) = PB_Cnumroc( K, JA, INB_A, NB_A, MYCOL, CSRC_A, NPCOL )
132 *
133 * Arguments
134 * =========
135 *
136 * UPLO (global input) CHARACTER*1
137 * On entry, UPLO specifies whether the local pieces of
138 * the array C containing the upper or lower triangular part
139 * of the symmetric submatrix sub( C ) are to be referenced as
140 * follows:
141 *
142 * UPLO = 'U' or 'u' Only the local pieces corresponding to
143 * the upper triangular part of the
144 * symmetric submatrix sub( C ) are to be
145 * referenced,
146 *
147 * UPLO = 'L' or 'l' Only the local pieces corresponding to
148 * the lower triangular part of the
149 * symmetric submatrix sub( C ) are to be
150 * referenced.
151 *
152 * TRANS (global input) CHARACTER*1
153 * On entry, TRANS specifies the operation to be performed as
154 * follows:
155 *
156 * TRANS = 'N' or 'n'
157 * sub( C ) := alpha*sub( A )*sub( B )' +
158 * alpha*sub( B )*sub( A )' +
159 * beta*sub( C ),
160 *
161 * TRANS = 'T' or 't'
162 * sub( C ) := alpha*sub( B )'*sub( A ) +
163 * alpha*sub( A )'*sub( B ) +
164 * beta*sub( C ).
165 *
166 * N (global input) INTEGER
167 * On entry, N specifies the order of the submatrix sub( C ).
168 * N must be at least zero.
169 *
170 * K (global input) INTEGER
171 * On entry with TRANS = 'N' or 'n', K specifies the number of
172 * columns of the submatrices sub( A ) and sub( B ), and on
173 * entry with TRANS = 'T' or 't', K specifies the number of rows
174 * of the submatrices sub( A ) and sub( B ). K must be at least
175 * zero.
176 *
177 * ALPHA (global input) COMPLEX*16
178 * On entry, ALPHA specifies the scalar alpha. When ALPHA is
179 * supplied as zero then the local entries of the arrays A
180 * and B corresponding to the entries of the submatrices
181 * sub( A ) and sub( B ) respectively need not be set on input.
182 *
183 * A (local input) COMPLEX*16 array
184 * On entry, A is an array of dimension (LLD_A, Ka), where Ka is
185 * at least Lc( 1, JA+K-1 ) when TRANS = 'N' or 'n', and is at
186 * least Lc( 1, JA+N-1 ) otherwise. Before entry, this array
187 * contains the local entries of the matrix A.
188 * Before entry with TRANS = 'N' or 'n', this array contains the
189 * local entries corresponding to the entries of the n by k sub-
190 * matrix sub( A ), otherwise the local entries corresponding to
191 * the entries of the k by n submatrix sub( A ).
192 *
193 * IA (global input) INTEGER
194 * On entry, IA specifies A's global row index, which points to
195 * the beginning of the submatrix sub( A ).
196 *
197 * JA (global input) INTEGER
198 * On entry, JA specifies A's global column index, which points
199 * to the beginning of the submatrix sub( A ).
200 *
201 * DESCA (global and local input) INTEGER array
202 * On entry, DESCA is an integer array of dimension DLEN_. This
203 * is the array descriptor for the matrix A.
204 *
205 * B (local input) COMPLEX*16 array
206 * On entry, B is an array of dimension (LLD_B, Kb), where Kb is
207 * at least Lc( 1, JB+K-1 ) when TRANS = 'N' or 'n', and is at
208 * least Lc( 1, JB+N-1 ) otherwise. Before entry, this array
209 * contains the local entries of the matrix B.
210 * Before entry with TRANS = 'N' or 'n', this array contains the
211 * local entries corresponding to the entries of the n by k sub-
212 * matrix sub( B ), otherwise the local entries corresponding to
213 * the entries of the k by n submatrix sub( B ).
214 *
215 * IB (global input) INTEGER
216 * On entry, IB specifies B's global row index, which points to
217 * the beginning of the submatrix sub( B ).
218 *
219 * JB (global input) INTEGER
220 * On entry, JB specifies B's global column index, which points
221 * to the beginning of the submatrix sub( B ).
222 *
223 * DESCB (global and local input) INTEGER array
224 * On entry, DESCB is an integer array of dimension DLEN_. This
225 * is the array descriptor for the matrix B.
226 *
227 * BETA (global input) COMPLEX*16
228 * On entry, BETA specifies the scalar beta. When BETA is
229 * supplied as zero then the local entries of the array C
230 * corresponding to the entries of the submatrix sub( C ) need
231 * not be set on input.
232 *
233 * C (local input/local output) COMPLEX*16 array
234 * On entry, C is an array of dimension (LLD_C, Kc), where Kc is
235 * at least Lc( 1, JC+N-1 ). Before entry, this array contains
236 * the local entries of the matrix C.
237 * Before entry with UPLO = 'U' or 'u', this array contains
238 * the local entries corresponding to the upper triangular part
239 * of the symmetric submatrix sub( C ), and the local entries
240 * corresponding to the strictly lower triangular of sub( C )
241 * are not referenced. On exit, the upper triangular part of
242 * sub( C ) is overwritten by the upper triangular part of the
243 * updated submatrix.
244 * Before entry with UPLO = 'L' or 'l', this array contains
245 * the local entries corresponding to the lower triangular part
246 * of the symmetric submatrix sub( C ), and the local entries
247 * corresponding to the strictly upper triangular of sub( C )
248 * are not referenced. On exit, the lower triangular part of
249 * sub( C ) is overwritten by the lower triangular part of the
250 * updated submatrix.
251 *
252 * IC (global input) INTEGER
253 * On entry, IC specifies C's global row index, which points to
254 * the beginning of the submatrix sub( C ).
255 *
256 * JC (global input) INTEGER
257 * On entry, JC specifies C's global column index, which points
258 * to the beginning of the submatrix sub( C ).
259 *
260 * DESCC (global and local input) INTEGER array
261 * On entry, DESCC is an integer array of dimension DLEN_. This
262 * is the array descriptor for the matrix C.
263 *
264 * -- Written on April 1, 1998 by
265 * Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
266 *
267 * ---------------------------------------------------------------------
268 */
269 /*
270 * .. Local Scalars ..
271 */
272  char DirA, OpC, OpR, TopC, TopR, TranOp, UploC, ctop, ctopsave,
273  rtop, rtopsave;
274  int Ai, Aj, Bi, Bj, ChooseABC, Ci, Cj, ForceTop, ctxt, info,
275  mycol, myrow, nb, notran, npcol, nprow, upper;
276  double ABCest, ABest, tmp1, tmp2, tmp3, tmp4;
277  PBTYP_T * type;
278 /*
279 * .. Local Arrays ..
280 */
281  int Ad[DLEN_], Bd[DLEN_], Cd[DLEN_];
282 /* ..
283 * .. Executable Statements ..
284 *
285 */
286  upper = ( ( UploC = Mupcase( F2C_CHAR( UPLO )[0] ) ) == CUPPER );
287  notran = ( ( TranOp = Mupcase( F2C_CHAR( TRANS )[0] ) ) == CNOTRAN );
288  PB_CargFtoC( *IA, *JA, DESCA, &Ai, &Aj, Ad );
289  PB_CargFtoC( *IB, *JB, DESCB, &Bi, &Bj, Bd );
290  PB_CargFtoC( *IC, *JC, DESCC, &Ci, &Cj, Cd );
291 #ifndef NO_ARGCHK
292 /*
293 * Test the input parameters
294 */
295  Cblacs_gridinfo( ( ctxt = Ad[CTXT_] ), &nprow, &npcol, &myrow, &mycol );
296  if( !( info = ( ( nprow == -1 ) ? -( 901 + CTXT_ ) : 0 ) ) )
297  {
298  if( ( !upper ) && ( UploC != CLOWER ) )
299  {
300  PB_Cwarn( ctxt, __LINE__, "PZSYR2K", "Illegal UPLO = %c\n", UploC );
301  info = -1;
302  }
303  else if( ( !notran ) && ( TranOp != CTRAN ) )
304  {
305  PB_Cwarn( ctxt, __LINE__, "PZSYR2K", "Illegal TRANS = %c\n", TranOp );
306  info = -2;
307  }
308  if( notran )
309  {
310  PB_Cchkmat( ctxt, "PZSYR2K", "A", *N, 3, *K, 4, Ai, Aj, Ad, 9,
311  &info );
312  PB_Cchkmat( ctxt, "PZSYR2K", "B", *N, 3, *K, 4, Bi, Bj, Bd, 13,
313  &info );
314  }
315  else
316  {
317  PB_Cchkmat( ctxt, "PZSYR2K", "A", *K, 4, *N, 3, Ai, Aj, Ad, 9,
318  &info );
319  PB_Cchkmat( ctxt, "PZSYR2K", "B", *K, 4, *N, 3, Bi, Bj, Bd, 13,
320  &info );
321  }
322  PB_Cchkmat( ctxt, "PZSYR2K", "C", *N, 3, *N, 3, Ci, Cj, Cd, 18,
323  &info );
324  }
325  if( info ) { PB_Cabort( ctxt, "PZSYR2K", info ); return; }
326 #endif
327 /*
328 * Quick return if possible
329 */
330  if( ( *N == 0 ) ||
331  ( ( ( ( ALPHA[REAL_PART] == ZERO ) && ( ALPHA[IMAG_PART] == ZERO ) ) ||
332  ( *K == 0 ) ) &&
333  ( ( BETA[REAL_PART] == ONE ) && ( BETA[IMAG_PART] == ZERO ) ) ) )
334  return;
335 /*
336 * Get type structure
337 */
338  type = PB_Cztypeset();
339 /*
340 * And when alpha or K is zero
341 */
342  if( ( ( ALPHA[REAL_PART] == ZERO ) && ( ALPHA[IMAG_PART] == ZERO ) ) ||
343  ( *K == 0 ) )
344  {
345  if( ( BETA[REAL_PART] == ZERO ) && ( BETA[IMAG_PART] == ZERO ) )
346  {
347  PB_Cplapad( type, &UploC, NOCONJG, *N, *N, type->zero, type->zero,
348  ((char *) C), Ci, Cj, Cd );
349  }
350  else
351  {
352  PB_Cplascal( type, &UploC, NOCONJG, *N, *N, ((char *) BETA),
353  ((char *) C), Ci, Cj, Cd );
354  }
355  return;
356  }
357 /*
358 * Start the operations
359 */
360 #ifdef NO_ARGCHK
361  Cblacs_gridinfo( ( ctxt = Ad[CTXT_] ), &nprow, &npcol, &myrow, &mycol );
362 #endif
363 /*
364 * Algorithm selection is based on approximation of the communication volume
365 * for distributed and aligned operands.
366 *
367 * ABCest: operands sub( A ), sub( B ) and sub( C ) are communicated (K >> N)
368 * ABest : only sub( A ) and sub( B ) are communicated (N >> K)
369 */
370  if( notran )
371  {
372  tmp1 = DNROC( *N, Cd[MB_], nprow );
373  tmp3 = DNROC( *K, Ad[NB_], npcol ); tmp4 = DNROC( *K, Bd[NB_], npcol );
374  ABCest = (double)(*N) *
375  ( ( ( ( Ad[RSRC_] == -1 ) || ( nprow == 1 ) ) ? ZERO : tmp3 ) +
376  ( ( ( Bd[RSRC_] == -1 ) || ( nprow == 1 ) ) ? ZERO : tmp4 ) +
377  ( ( ( ( Ad[CSRC_] == -1 ) && ( Bd[CSRC_] == -1 ) ) ||
378  ( npcol == 1 ) ) ? ZERO : CBRATIO * tmp1 / TWO ) );
379  tmp1 = DNROC( *N, Cd[MB_], nprow ); tmp2 = DNROC( *N, Cd[NB_], npcol );
380  tmp3 = DNROC( *N, Ad[MB_], nprow ); tmp4 = DNROC( *N, Bd[MB_], nprow );
381  ABest = (double)(*K) *
382  ( ( ( ( Ad[CSRC_] == -1 ) || ( npcol == 1 ) ) ? ZERO : tmp1 ) +
383  ( ( ( Bd[CSRC_] == -1 ) || ( npcol == 1 ) ) ? ZERO : tmp1 ) +
384  TWO * ( nprow == 1 ? ZERO : tmp2 ) +
385  MAX( tmp2, tmp3 ) + MAX( tmp2, tmp4 ) );
386  }
387  else
388  {
389  tmp2 = DNROC( *N, Cd[NB_], npcol );
390  tmp3 = DNROC( *K, Ad[MB_], nprow ); tmp4 = DNROC( *K, Bd[MB_], nprow );
391  ABCest = (double)(*N) *
392  ( ( ( ( Ad[CSRC_] == -1 ) || ( npcol == 1 ) ) ? ZERO : tmp3 ) +
393  ( ( ( Bd[CSRC_] == -1 ) || ( npcol == 1 ) ) ? ZERO : tmp4 ) +
394  ( ( ( ( Ad[RSRC_] == -1 ) && ( Bd[RSRC_] == -1 ) ) ||
395  ( nprow == 1 ) ) ? ZERO : CBRATIO * tmp2 / TWO ) );
396  tmp1 = DNROC( *N, Cd[MB_], nprow ); tmp2 = DNROC( *N, Cd[NB_], npcol );
397  tmp3 = DNROC( *N, Ad[NB_], npcol ); tmp4 = DNROC( *N, Bd[NB_], npcol );
398  ABest = (double)(*K) *
399  ( ( ( ( Ad[RSRC_] == -1 ) || ( nprow == 1 ) ) ? ZERO : tmp2 ) +
400  ( ( ( Bd[RSRC_] == -1 ) || ( nprow == 1 ) ) ? ZERO : tmp2 ) +
401  TWO * ( npcol == 1 ? ZERO : tmp1 ) +
402  MAX( tmp1, tmp3 ) + MAX( tmp1, tmp4 ) );
403  }
404 /*
405 * Shift a little the cross-over point between both algorithms.
406 */
407  ChooseABC = ( ( 1.4 * ABCest ) <= ABest );
408 /*
409 * BLACS topologies are enforced iff N and K are strictly greater than the
410 * logical block size returned by pilaenv_. Otherwise, it is assumed that the
411 * routine calling this routine has already selected an adequate topology.
412 */
413  nb = pilaenv_( &ctxt, C2F_CHAR( &type->type ) );
414  ForceTop = ( ( *N > nb ) && ( *K > nb ) );
415 
416  if( ChooseABC )
417  {
418  if( notran )
419  {
420  OpC = CBCAST;
421  ctop = *PB_Ctop( &ctxt, &OpC, COLUMN, TOP_GET );
422 
423  if( ForceTop )
424  {
425  OpR = CCOMBINE;
426  rtop = *PB_Ctop( &ctxt, &OpR, ROW, TOP_GET );
427 
428  rtopsave = rtop;
429  ctopsave = ctop;
430 
431  if( upper ) { TopR = CTOP_IRING; TopC = CTOP_DRING; }
432  else { TopR = CTOP_DRING; TopC = CTOP_IRING; }
433 
434  ctop = *PB_Ctop( &ctxt, &OpC, COLUMN, &TopC );
435  rtop = *PB_Ctop( &ctxt, &OpR, ROW, &TopR );
436 /*
437 * Remove the next line when the BLACS combine operations support ring
438 * topologies
439 */
440  rtop = *PB_Ctop( &ctxt, &OpR, ROW, TOP_DEFAULT );
441  }
442 
443  DirA = ( ctop == CTOP_DRING ? CBACKWARD : CFORWARD );
444  }
445  else
446  {
447  OpR = CBCAST;
448  rtop = *PB_Ctop( &ctxt, &OpR, ROW, TOP_GET );
449 
450  if( ForceTop )
451  {
452  OpC = CCOMBINE;
453  ctop = *PB_Ctop( &ctxt, &OpC, COLUMN, TOP_GET );
454 
455  rtopsave = rtop;
456  ctopsave = ctop;
457 
458  if( upper ) { TopR = CTOP_IRING; TopC = CTOP_DRING; }
459  else { TopR = CTOP_DRING; TopC = CTOP_IRING; }
460 
461  rtop = *PB_Ctop( &ctxt, &OpR, ROW, &TopR );
462  ctop = *PB_Ctop( &ctxt, &OpC, COLUMN, &TopC );
463 /*
464 * Remove the next line when the BLACS combine operations support ring
465 * topologies
466 */
467  ctop = *PB_Ctop( &ctxt, &OpC, COLUMN, TOP_DEFAULT );
468  }
469 
470  DirA = ( rtop == CTOP_DRING ? CBACKWARD : CFORWARD );
471  }
472 
473  PB_Cpsyr2kAC( type, &DirA, NOCONJG, &UploC, ( notran ? NOTRAN : TRAN ),
474  *N, *K, ((char *)ALPHA), ((char *)A), Ai, Aj, Ad,
475  ((char *)B), Bi, Bj, Bd, ((char *)BETA), ((char *)C), Ci,
476  Cj, Cd );
477  }
478  else
479  {
480  if( notran )
481  {
482  OpR = CBCAST;
483  rtop = *PB_Ctop( &ctxt, &OpR, ROW, TOP_GET );
484 
485  if( ForceTop )
486  {
487  OpC = CBCAST;
488  ctop = *PB_Ctop( &ctxt, &OpC, COLUMN, TOP_GET );
489 
490  rtopsave = rtop;
491  ctopsave = ctop;
492 /*
493 * No clear winner for the ring topologies, so that if a ring topology is
494 * already selected, keep it.
495 */
496  if( ( rtop != CTOP_DRING ) && ( rtop != CTOP_IRING ) &&
497  ( rtop != CTOP_SRING ) )
498  rtop = *PB_Ctop( &ctxt, &OpR, ROW, TOP_SRING );
499  if( ( ctop != CTOP_DRING ) && ( ctop != CTOP_IRING ) &&
500  ( ctop != CTOP_SRING ) )
501  ctop = *PB_Ctop( &ctxt, &OpC, COLUMN, TOP_SRING );
502  }
503 
504  DirA = ( rtop == CTOP_DRING ? CBACKWARD : CFORWARD );
505  }
506  else
507  {
508  OpC = CBCAST;
509  ctop = *PB_Ctop( &ctxt, &OpC, COLUMN, TOP_GET );
510 
511  if( ForceTop )
512  {
513  OpR = CBCAST;
514  rtop = *PB_Ctop( &ctxt, &OpR, ROW, TOP_GET );
515 
516  rtopsave = rtop;
517  ctopsave = ctop;
518 /*
519 * No clear winner for the ring topologies, so that if a ring topology is
520 * already selected, keep it.
521 */
522  if( ( rtop != CTOP_DRING ) && ( rtop != CTOP_IRING ) &&
523  ( rtop != CTOP_SRING ) )
524  rtop = *PB_Ctop( &ctxt, &OpR, ROW, TOP_SRING );
525  if( ( ctop != CTOP_DRING ) && ( ctop != CTOP_IRING ) &&
526  ( ctop != CTOP_SRING ) )
527  ctop = *PB_Ctop( &ctxt, &OpC, COLUMN, TOP_SRING );
528  }
529 
530  DirA = ( ctop == CTOP_DRING ? CBACKWARD : CFORWARD );
531  }
532 
533  PB_Cpsyr2kA( type, &DirA, NOCONJG, &UploC, ( notran ? NOTRAN : TRAN ), *N,
534  *K, ((char *)ALPHA), ((char *)A), Ai, Aj, Ad, ((char *)B),
535  Bi, Bj, Bd, ((char *)BETA), ((char *)C), Ci, Cj, Cd );
536  }
537 /*
538 * Restore the BLACS topologies when necessary.
539 */
540  if( ForceTop )
541  {
542  rtopsave = *PB_Ctop( &ctxt, &OpR, ROW, &rtopsave );
543  ctopsave = *PB_Ctop( &ctxt, &OpC, COLUMN, &ctopsave );
544  }
545 /*
546 * End of PZSYR2K
547 */
548 }
TOP_SRING
#define TOP_SRING
Definition: PBblacs.h:54
ROW
#define ROW
Definition: PBblacs.h:46
MB_
#define MB_
Definition: PBtools.h:43
TOP_DEFAULT
#define TOP_DEFAULT
Definition: PBblacs.h:51
PB_Cwarn
void PB_Cwarn()
NB_
#define NB_
Definition: PBtools.h:44
COLUMN
#define COLUMN
Definition: PBblacs.h:45
CSRC_
#define CSRC_
Definition: PBtools.h:46
PBblacs.h
PBtools.h
PBblas.h
CBCAST
#define CBCAST
Definition: PBblacs.h:23
NOCONJG
#define NOCONJG
Definition: PBblas.h:45
PB_Cpsyr2kA
void PB_Cpsyr2kA()
REAL_PART
#define REAL_PART
Definition: pblas.h:135
PBTYP_T::type
char type
Definition: pblas.h:327
PBpblas.h
PB_Cztypeset
PBTYP_T * PB_Cztypeset()
Definition: PB_Cztypeset.c:19
DLEN_
#define DLEN_
Definition: PBtools.h:48
TRAN
#define TRAN
Definition: PBblas.h:46
NOTRAN
#define NOTRAN
Definition: PBblas.h:44
CTOP_IRING
#define CTOP_IRING
Definition: PBblacs.h:27
F_CHAR_T
char * F_CHAR_T
Definition: pblas.h:118
ZERO
#define ZERO
Definition: PBtools.h:66
CTOP_DRING
#define CTOP_DRING
Definition: PBblacs.h:28
pzsyr2k_
void pzsyr2k_(F_CHAR_T UPLO, F_CHAR_T TRANS, int *N, int *K, double *ALPHA, double *A, int *IA, int *JA, int *DESCA, double *B, int *IB, int *JB, int *DESCB, double *BETA, double *C, int *IC, int *JC, int *DESCC)
Definition: pzsyr2k_.c:27
pilaenv_
int pilaenv_()
PB_Cplascal
void PB_Cplascal()
PB_Cpsyr2kAC
void PB_Cpsyr2kAC()
CTOP_SRING
#define CTOP_SRING
Definition: PBblacs.h:29
PB_Cabort
void PB_Cabort()
CLOWER
#define CLOWER
Definition: PBblas.h:25
PB_Cplapad
void PB_Cplapad()
F2C_CHAR
#define F2C_CHAR(a)
Definition: pblas.h:120
TOP_GET
#define TOP_GET
Definition: PBblacs.h:50
PB_Ctop
char * PB_Ctop()
ONE
#define ONE
Definition: PBtools.h:64
RSRC_
#define RSRC_
Definition: PBtools.h:45
CNOTRAN
#define CNOTRAN
Definition: PBblas.h:18
PB_CargFtoC
void PB_CargFtoC()
PB_Cchkmat
void PB_Cchkmat()
CFORWARD
#define CFORWARD
Definition: PBblas.h:38
C2F_CHAR
#define C2F_CHAR(a)
Definition: pblas.h:121
CBRATIO
#define CBRATIO
Definition: pblas.h:37
MAX
#define MAX(a_, b_)
Definition: PBtools.h:77
Cblacs_gridinfo
void Cblacs_gridinfo()
PBTYP_T
Definition: pblas.h:325
Mupcase
#define Mupcase(C)
Definition: PBtools.h:83
pblas.h
CUPPER
#define CUPPER
Definition: PBblas.h:26
CTRAN
#define CTRAN
Definition: PBblas.h:20
CCOMBINE
#define CCOMBINE
Definition: PBblacs.h:24
TWO
#define TWO
Definition: PBtools.h:65
CBACKWARD
#define CBACKWARD
Definition: PBblas.h:39
CTXT_
#define CTXT_
Definition: PBtools.h:38
IMAG_PART
#define IMAG_PART
Definition: pblas.h:136
PBTYP_T::zero
char * zero
Definition: pblas.h:331
DNROC
#define DNROC(n_, nb_, p_)
Definition: PBtools.h:111