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_Ctzhemm(
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;
185 char * Calph, * one, type;
186 int i1, j1, m1, mn, n1, size;
194 if( ( M <= 0 ) || ( N <= 0 ) )
return;
199 { Calph = ( (
char *)(Calph8 ) );
PB_Cconjg(
TYPE, ALPHA, Calph ); }
200 else if( type ==
DCPLX )
201 { Calph = ( (
char *)(Calph16) );
PB_Cconjg(
TYPE, ALPHA, Calph ); }
210 mn =
MAX( 0, -IOFFD );
211 if( ( n1 =
MIN( mn, N ) ) > 0 )
214 A, &LDA, BR, &LDBR, one, CC, &LDCC );
216 BC, &LDBC, A, &LDA, one, CR, &LDCR );
219 if( ( n1 =
MIN( n1, N ) - mn ) > 0 )
221 i1 = ( j1 = mn ) + IOFFD;
223 Mptr( A, i1, j1, LDA, size ), &LDA,
Mptr( BC, i1, 0,
224 LDBC, size ), &LDBC, one,
Mptr( CC, i1, 0, LDCC,
226 if( ( m1 = M - mn - n1 - IOFFD ) > 0 )
230 Mptr( A, i1, j1, LDA, size ), &LDA,
Mptr( BR, 0, j1, LDBR,
231 size ), &LDBR, one,
Mptr( CC, i1, 0, LDCC, size ), &LDCC );
233 Calph,
Mptr( BC, i1, 0, LDBC, size ), &LDBC,
Mptr( A, i1,
234 j1, LDA, size ), &LDA, one,
Mptr( CR, 0, j1, LDCR, size ),
242 mn =
MIN( M - IOFFD, N );
243 if( ( n1 = mn -
MAX( 0, -IOFFD ) ) > 0 )
246 if( ( m1 =
MAX( 0, IOFFD ) ) > 0 )
249 A, &LDA, BR, &LDBR, one, CC, &LDCC );
251 Calph, BC, &LDBC, A, &LDA, one, CR, &LDCR );
254 Mptr( A, m1, j1, LDA, size ), &LDA,
Mptr( BC, m1, 0,
255 LDBC, size ), &LDBC, one,
Mptr( CC, m1, 0, LDCC,
258 if( ( n1 = N -
MAX( 0, mn ) ) > 0 )
262 Mptr( A, 0, j1, LDA, size ), &LDA,
Mptr( BR, 0, j1, LDBR,
263 size ), &LDBR, one, CC, &LDCC );
265 BC, &LDBC,
Mptr( A, 0, j1, LDA, size ), &LDA, one,
Mptr( CR,
266 0, j1, LDCR, size ), &LDCR );
271 one =
TYPE->one; gemm =
TYPE->Fgemm;
273 &LDA, BR, &LDBR, one, CC, &LDCC );
275 &LDBC, A, &LDA, one, CR, &LDCR );
283 mn =
MAX( 0, -IOFFD );
284 if( ( n1 =
MIN( mn, N ) ) > 0 )
287 A, &LDA, BR, &LDBR, one, CC, &LDCC );
289 BC, &LDBC, A, &LDA, one, CR, &LDCR );
292 if( ( n1 =
MIN( n1, N ) - mn ) > 0 )
294 i1 = ( j1 = mn ) + IOFFD;
296 Mptr( A, i1, j1, LDA, size ), &LDA,
Mptr( BR, 0, j1,
297 LDBR, size ), &LDBR, one,
Mptr( CR, 0, j1, LDCR,
299 if( ( m1 = M - mn - n1 - IOFFD ) > 0 )
303 Calph,
Mptr( A, i1, j1, LDA, size ), &LDA,
Mptr( BR, 0, j1,
304 LDBR, size ), &LDBR, one,
Mptr( CC, i1, 0, LDCC, size ),
307 Mptr( BC, i1, 0, LDBC, size ), &LDBC,
Mptr( A, i1, j1, LDA,
308 size ), &LDA, one,
Mptr( CR, 0, j1, LDCR, size ), &LDCR );
315 mn =
MIN( M - IOFFD, N );
316 if( ( n1 = mn -
MAX( 0, -IOFFD ) ) > 0 )
319 if( ( m1 =
MAX( 0, IOFFD ) ) > 0 )
322 Calph, A, &LDA, BR, &LDBR, one, CC, &LDCC );
324 ALPHA, BC, &LDBC, A, &LDA, one, CR, &LDCR );
327 Mptr( A, m1, j1, LDA, size ), &LDA,
Mptr( BR, 0, j1,
328 LDBR, size ), &LDBR, one,
Mptr( CR, 0, j1, LDCR,
331 if( ( n1 = N -
MAX( 0, mn ) ) > 0 )
335 Mptr( A, 0, j1, LDA, size ), &LDA,
Mptr( BR, 0, j1, LDBR,
336 size ), &LDBR, one, CC, &LDCC );
338 &LDBC,
Mptr( A, 0, j1, LDA, size ), &LDA, one,
Mptr( CR, 0,
339 j1, LDCR, size ), &LDCR );
344 one =
TYPE->one; gemm =
TYPE->Fgemm;
346 &LDA, BR, &LDBR, one, CC, &LDCC );
348 &LDBC, A, &LDA, one, CR, &LDCR );