14 #include "../PBpblas.h"
15 #include "../PBtools.h"
16 #include "../PBblacs.h"
17 #include "../PBblas.h"
21 int K,
int IOFFD,
char * ALPHA,
char * A,
int LDA,
22 char * BC,
int LDBC,
char * BR,
int LDBR,
char * CC,
23 int LDCC,
char * CR,
int LDCR )
25 void PB_Ctzsymm(
TYPE, SIDE, UPLO, M, N, K, IOFFD, ALPHA, A, LDA, BC,
26 LDBC, BR, LDBR, CC, LDCC, CR, LDCR )
31 int IOFFD, K, LDA, LDBC, LDBR, LDCC, LDCR, M, N;
37 char * A, * BC, * BR, * CC, * CR;
186 int i1, j1, m1, mn, n1, size;
192 if( ( M <= 0 ) || ( N <= 0 ) )
return;
199 mn =
MAX( 0, -IOFFD );
201 if( ( n1 =
MIN( mn, N ) ) > 0 )
204 &LDA, BR, &LDBR, one, CC, &LDCC );
206 &LDBC, A, &LDA, one, CR, &LDCR );
209 if( ( n1 =
MIN( n1, N ) - mn ) > 0 )
211 i1 = ( j1 = mn ) + IOFFD;
213 Mptr( A, i1, j1, LDA, size ), &LDA,
Mptr( BC, i1, 0,
214 LDBC, size ), &LDBC, one,
Mptr( CC, i1, 0, LDCC,
216 if( ( m1 = M - mn - n1 - IOFFD ) > 0 )
220 Mptr( A, i1, j1, LDA, size ), &LDA,
Mptr( BR, 0, j1, LDBR,
221 size ), &LDBR, one,
Mptr( CC, i1, 0, LDCC, size ), &LDCC );
223 Mptr( BC, i1, 0, LDBC, size ), &LDBC,
Mptr( A, i1, j1, LDA,
224 size ), &LDA, one,
Mptr( CR, 0, j1, LDCR, size ), &LDCR );
231 mn =
MIN( M - IOFFD, N );
233 if( ( n1 = mn -
MAX( 0, -IOFFD ) ) > 0 )
236 if( ( m1 =
MAX( 0, IOFFD ) ) > 0 )
239 ALPHA, A, &LDA, BR, &LDBR, one, CC, &LDCC );
241 ALPHA, BC, &LDBC, A, &LDA, one, CR, &LDCR );
244 Mptr( A, m1, j1, LDA, size ), &LDA,
245 Mptr( BC, m1, 0, LDBC, size ), &LDBC, one,
246 Mptr( CC, m1, 0, LDCC, size ), &LDCC );
248 if( ( n1 = N -
MAX( 0, mn ) ) > 0 )
252 ALPHA,
Mptr( A, 0, j1, LDA, size ), &LDA,
Mptr( BR, 0,
253 j1, LDBR, size ), &LDBR, one, CC, &LDCC );
255 ALPHA, BC, &LDBC,
Mptr( A, 0, j1, LDA, size ), &LDA,
256 one,
Mptr( CR, 0, j1, LDCR, size ), &LDCR );
261 one =
TYPE->one; gemm =
TYPE->Fgemm;
263 BR, &LDBR, one, CC, &LDCC );
265 &LDBC, A, &LDA, one, CR, &LDCR );
273 mn =
MAX( 0, -IOFFD );
274 if( ( n1 =
MIN( mn, N ) ) > 0 )
277 &LDA, BR, &LDBR, one, CC, &LDCC );
279 &LDBC, A, &LDA, one, CR, &LDCR );
282 if( ( n1 =
MIN( n1, N ) - mn ) > 0 )
284 i1 = ( j1 = mn ) + IOFFD;
286 Mptr( A, i1, j1, LDA, size ), &LDA,
287 Mptr( BR, 0, j1, LDBR, size ), &LDBR, one,
288 Mptr( CR, 0, j1, LDCR, size ), &LDCR );
289 if( ( m1 = M - mn - n1 - IOFFD ) > 0 )
293 Mptr( A, i1, j1, LDA, size ), &LDA,
Mptr( BR, 0, j1, LDBR,
294 size ), &LDBR, one,
Mptr( CC, i1, 0, LDCC, size ), &LDCC );
296 Mptr( BC, i1, 0, LDBC, size ), &LDBC,
Mptr( A, i1, j1, LDA,
297 size ), &LDA, one,
Mptr( CR, 0, j1, LDCR, size ), &LDCR );
304 mn =
MIN( M - IOFFD, N );
305 if( ( n1 = mn -
MAX( 0, -IOFFD ) ) > 0 )
308 if( ( m1 =
MAX( 0, IOFFD ) ) > 0 )
311 A, &LDA, BR, &LDBR, one, CC, &LDCC );
313 BC, &LDBC, A, &LDA, one, CR, &LDCR );
316 Mptr( A, m1, j1, LDA, size ), &LDA,
Mptr( BR, 0, j1,
317 LDBR, size ), &LDBR, one,
Mptr( CR, 0, j1, LDCR,
320 if( ( n1 = N -
MAX( 0, mn ) ) > 0 )
324 Mptr( A, 0, j1, LDA, size ), &LDA,
Mptr( BR, 0, j1, LDBR,
325 size ), &LDBR, one, CC, &LDCC );
327 &LDBC,
Mptr( A, 0, j1, LDA, size ), &LDA, one,
Mptr( CR, 0,
328 j1, LDCR, size ), &LDCR );
333 one =
TYPE->one; gemm =
TYPE->Fgemm;
335 BR, &LDBR, one, CC, &LDCC );
337 &LDBC, A, &LDA, one, CR, &LDCR );