14 #include "../PBpblas.h"
15 #include "../PBtools.h"
16 #include "../PBblacs.h"
17 #include "../PBblas.h"
21 int IOFFD,
char * ALPHA,
char * XC,
int LDXC,
22 char * YC,
int LDYC,
char * XR,
int LDXR,
char * YR,
23 int LDYR,
char * A,
int LDA )
25 void PB_Ctzher2(
TYPE, UPLO, M, N, K, IOFFD, ALPHA, XC, LDXC, YC, LDYC,
26 XR, LDXR, YR, LDYR, A, LDA )
31 int IOFFD, K, LDA, LDXC, LDXR, LDYC, LDYR, M, N;
36 char * A, * XC, * XR, * YC, * YR;
173 int i1, ione=1, j1, m1, mn, n1, size;
182 if( ( M <= 0 ) || ( N <= 0 ) )
return;
186 { Calph = ( (
char *)(Calph8) );
PB_Cconjg(
TYPE, ALPHA, Calph ); }
187 else if( type ==
DCPLX )
188 { Calph = ( (
char *)(Calph16) );
PB_Cconjg(
TYPE, ALPHA, Calph ); }
194 size =
TYPE->size; gerc =
TYPE->Fgerc;
195 mn =
MAX( 0, -IOFFD );
196 if( ( n1 =
MIN( mn, N ) ) > 0 )
198 gerc( &M, &n1, ALPHA, XC, &ione, YR, &LDYR, A, &LDA );
199 gerc( &M, &n1, Calph, YC, &ione, XR, &LDXR, A, &LDA );
202 if( ( n1 =
MIN( n1, N ) - mn ) > 0 )
204 i1 = ( j1 = mn ) + IOFFD;
206 size ), &ione,
Mptr( YR, 0, j1, LDYR, size ), &LDYR,
207 Mptr( A, i1, j1, LDA, size ), &LDA );
208 if( ( m1 = M - mn - n1 - IOFFD ) > 0 )
211 gerc( &m1, &n1, ALPHA,
Mptr( XC, i1, 0, LDXC, size ), &ione,
212 Mptr( YR, 0, j1, LDYR, size ), &LDYR,
Mptr( A, i1, j1, LDA,
214 gerc( &m1, &n1, Calph,
Mptr( YC, i1, 0, LDYC, size ), &ione,
215 Mptr( XR, 0, j1, LDXR, size ), &LDXR,
Mptr( A, i1, j1, LDA,
222 size =
TYPE->size; gerc =
TYPE->Fgerc;
223 mn = M - IOFFD; mn =
MIN( mn, N );
224 if( ( n1 = mn -
MAX( 0, -IOFFD ) ) > 0 )
227 if( ( m1 =
MAX( 0, IOFFD ) ) > 0 )
229 gerc( &m1, &n1, ALPHA, XC, &ione, YR, &LDYR, A, &LDA );
230 gerc( &m1, &n1, Calph, YC, &ione, XR, &LDXR, A, &LDA );
233 size ), &ione,
Mptr( YR, 0, j1, LDYR, size ), &LDYR,
234 Mptr( A, m1, j1, LDA, size ), &LDA );
236 if( ( n1 = N -
MAX( 0, mn ) ) > 0 )
239 gerc( &M, &n1, ALPHA, XC, &ione,
Mptr( YR, 0, j1, LDYR, size ), &LDYR,
240 Mptr( A, 0, j1, LDA, size ), &LDA );
241 gerc( &M, &n1, Calph, YC, &ione,
Mptr( XR, 0, j1, LDXR, size ), &LDXR,
242 Mptr( A, 0, j1, LDA, size ), &LDA );
248 gerc( &M, &N, ALPHA, XC, &ione, YR, &LDYR, A, &LDA );
249 gerc( &M, &N, Calph, YC, &ione, XR, &LDXR, A, &LDA );