14 #include "../PBpblas.h"
15 #include "../PBtools.h"
16 #include "../PBblacs.h"
17 #include "../PBblas.h"
21 int IOFFD,
char * ALPHA,
char * AC,
int LDAC,
22 char * BC,
int LDBC,
char * AR,
int LDAR,
char * BR,
23 int LDBR,
char * C,
int LDC )
25 void PB_Ctzher2k(
TYPE, UPLO, M, N, K, IOFFD, ALPHA, AC, LDAC, BC, LDBC,
26 AR, LDAR, BR, LDBR, C, LDC )
31 int IOFFD, K, LDAC, LDAR, LDBC, LDBR, LDC, M, N;
36 char * AC, * AR, * BC, * BR, * C;
156 char * Calph, * one, type;
157 int i1, j1, m1, mn, n1, size;
165 if( ( M <= 0 ) || ( N <= 0 ) )
return;
170 { Calph = ( (
char *)(Calph8 ) );
PB_Cconjg(
TYPE, ALPHA, Calph ); }
171 else if( type ==
DCPLX )
172 { Calph = ( (
char *)(Calph16) );
PB_Cconjg(
TYPE, ALPHA, Calph ); }
179 mn =
MAX( 0, -IOFFD );
180 if( ( n1 =
MIN( mn, N ) ) > 0 )
183 &LDAC, BR, &LDBR, one, C, &LDC );
185 &LDBC, AR, &LDAR, one, C, &LDC );
188 if( ( n1 =
MIN( n1, N ) - mn ) > 0 )
190 i1 = ( j1 = mn ) + IOFFD;
192 Mptr( AC, i1, 0, LDAC, size ), &LDAC,
Mptr( BC, i1, 0,
193 LDBC, size ), &LDBC, one,
Mptr( C, i1, j1, LDC, size ),
195 if( ( m1 = M - mn - n1 - IOFFD ) > 0 )
199 Mptr( AC, i1, 0, LDAC, size ), &LDAC,
Mptr( BR, 0, j1, LDBR,
200 size ), &LDBR, one,
Mptr( C, i1, j1, LDC, size ), &LDC );
202 Mptr( BC, i1, 0, LDBC, size ), &LDBC,
Mptr( AR, 0, j1, LDAR,
203 size ), &LDAR, one,
Mptr( C, i1, j1, LDC, size ), &LDC );
210 mn = M - IOFFD; mn =
MIN( mn, N );
211 if( ( n1 = mn -
MAX( 0, -IOFFD ) ) > 0 )
214 if( ( m1 =
MAX( 0, IOFFD ) ) > 0 )
217 AC, &LDAC, BR, &LDBR, one, C, &LDC );
219 BC, &LDBC, AR, &LDAR, one, C, &LDC );
222 Mptr( AC, m1, 0, LDAC, size ), &LDAC,
Mptr( BC, m1, 0,
223 LDBC, size ), &LDBC, one,
Mptr( C, m1, j1, LDC, size ),
226 if( ( n1 = N -
MAX( 0, mn ) ) > 0 )
230 &LDAC,
Mptr( BR, 0, j1, LDBR, size ), &LDBR, one,
Mptr( C, 0, j1,
233 &LDBC,
Mptr( AR, 0, j1, LDAR, size ), &LDAR, one,
Mptr( C, 0, j1,
239 one =
TYPE->one; gemm =
TYPE->Fgemm;
241 &LDAC, BR, &LDBR, one, C, &LDC );
243 &LDBC, AR, &LDAR, one, C, &LDC );