libflame revision_anchor
Functions
bl1_her.c File Reference

(r)

Functions

void bl1_sher (uplo1_t uplo, conj1_t conj, int m, float *alpha, float *x, int incx, float *a, int a_rs, int a_cs)
 
void bl1_dher (uplo1_t uplo, conj1_t conj, int m, double *alpha, double *x, int incx, double *a, int a_rs, int a_cs)
 
void bl1_cher (uplo1_t uplo, conj1_t conj, int m, float *alpha, scomplex *x, int incx, scomplex *a, int a_rs, int a_cs)
 
void bl1_zher (uplo1_t uplo, conj1_t conj, int m, double *alpha, dcomplex *x, int incx, dcomplex *a, int a_rs, int a_cs)
 
void bl1_cher_blas (uplo1_t uplo, int m, float *alpha, scomplex *x, int incx, scomplex *a, int lda)
 
void bl1_zher_blas (uplo1_t uplo, int m, double *alpha, dcomplex *x, int incx, dcomplex *a, int lda)
 

Function Documentation

◆ bl1_cher()

void bl1_cher ( uplo1_t  uplo,
conj1_t  conj,
int  m,
float alpha,
scomplex x,
int  incx,
scomplex a,
int  a_rs,
int  a_cs 
)
32{
33 int m_save = m;
34 scomplex* a_save = a;
35 int a_rs_save = a_rs;
36 int a_cs_save = a_cs;
38 int incx_conj;
39 int lda, inca;
40
41 // Return early if possible.
42 if ( bl1_zero_dim1( m ) ) return;
43
44 // If necessary, allocate, initialize, and use a temporary contiguous
45 // copy of the matrix rather than the original matrix.
47 m,
48 m,
50 &a, &a_rs, &a_cs );
51
52 // Initialize with values assuming column-major storage.
53 lda = a_cs;
54 inca = a_rs;
55
56 // If A is a row-major matrix, then we can use the underlying column-major
57 // BLAS implementation by fiddling with the parameters.
59 {
61 bl1_toggle_uplo( uplo );
63 }
64
65 // Initialize with values assuming no conjugation of ( x * x' ).
66 x_conj = x;
68
69 // We want to handle the case where ( x * x' ) is conjugated, but
70 // without explicitly conjugating the matrix. To do so, we leverage
71 // the fact that computing the product conj( x * x' ) is equivalent
72 // to computing ( conj(x) * conj(x)' ), since ( x * x' ) is Hermitian.
73 if ( bl1_is_conj( conj ) )
74 {
75 x_conj = bl1_callocv( m );
76 incx_conj = 1;
77
79 m,
80 x, incx,
82 }
83
84 bl1_cher_blas( uplo,
85 m,
86 alpha,
88 a, lda );
89
90 // Free the temporary conjugated x vector.
91 if ( bl1_is_conj( conj ) )
93
94 // Free the temporary contiguous matrix.
96 m_save,
98 &a, &a_rs, &a_cs );
99}
int i
Definition bl1_axmyv2.c:145
void bl1_ccopyv(conj1_t conj, int m, scomplex *x, int incx, scomplex *y, int incy)
Definition bl1_copyv.c:49
void bl1_cher_blas(uplo1_t uplo, int m, float *alpha, scomplex *x, int incx, scomplex *a, int lda)
Definition bl1_her.c:173
int bl1_is_row_storage(int rs, int cs)
Definition bl1_is.c:95
int bl1_zero_dim1(int m)
Definition bl1_is.c:113
int bl1_is_conj(conj1_t conj)
Definition bl1_is.c:42
void bl1_cfree(scomplex *p)
Definition bl1_free.c:40
void bl1_ccreate_contigmr(uplo1_t uplo, int m, int n, scomplex *a_save, int a_rs_save, int a_cs_save, scomplex **a, int *a_rs, int *a_cs)
Definition bl1_create_contigmr.c:77
void bl1_cfree_saved_contigm(int m, int n, scomplex *a_save, int a_rs_save, int a_cs_save, scomplex **a, int *a_rs, int *a_cs)
Definition bl1_free_saved_contigm.c:59
scomplex * bl1_callocv(unsigned int n_elem)
Definition bl1_allocv.c:40
@ BLIS1_CONJUGATE
Definition blis_type_defs.h:82
Definition blis_type_defs.h:133

References bl1_callocv(), bl1_ccopyv(), bl1_ccreate_contigmr(), bl1_cfree(), bl1_cfree_saved_contigm(), bl1_cher_blas(), bl1_is_conj(), bl1_is_row_storage(), bl1_zero_dim1(), and BLIS1_CONJUGATE.

Referenced by FLA_Chol_l_opc_var3(), FLA_Chol_u_opc_var3(), FLA_Her_external(), FLA_Herc_external(), FLA_Ttmm_l_opc_var1(), and FLA_Ttmm_u_opc_var1().

◆ bl1_cher_blas()

void bl1_cher_blas ( uplo1_t  uplo,
int  m,
float alpha,
scomplex x,
int  incx,
scomplex a,
int  lda 
)
174{
175#ifdef BLIS1_ENABLE_CBLAS_INTERFACES
178
180
183 m,
184 *alpha,
185 x, incx,
186 a, lda );
187#else
188 char blas_uplo;
189
191
193 &m,
194 alpha,
195 x, &incx,
196 a, &lda );
197#endif
198}
void F77_cher(char *uplo, int *n, float *alpha, scomplex *x, int *incx, scomplex *a, int *lda)
CBLAS_ORDER
Definition blis_prototypes_cblas.h:17
@ CblasColMajor
Definition blis_prototypes_cblas.h:17
CBLAS_UPLO
Definition blis_prototypes_cblas.h:19
void cblas_cher(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const int N, const float alpha, const void *X, const int incX, void *A, const int lda)
void bl1_param_map_to_netlib_uplo(uplo1_t blis_uplo, void *blas_uplo)
Definition bl1_param_map.c:47

References bl1_param_map_to_netlib_uplo(), cblas_cher(), CblasColMajor, and F77_cher().

Referenced by bl1_cher().

◆ bl1_dher()

void bl1_dher ( uplo1_t  uplo,
conj1_t  conj,
int  m,
double alpha,
double x,
int  incx,
double a,
int  a_rs,
int  a_cs 
)
23{
24 bl1_dsyr( uplo,
25 m,
26 alpha,
27 x, incx,
28 a, a_rs, a_cs );
29}
void bl1_dsyr(uplo1_t uplo, int m, double *alpha, double *x, int incx, double *a, int a_rs, int a_cs)
Definition bl1_syr.c:57

References bl1_dsyr().

◆ bl1_sher()

void bl1_sher ( uplo1_t  uplo,
conj1_t  conj,
int  m,
float alpha,
float x,
int  incx,
float a,
int  a_rs,
int  a_cs 
)
14{
15 bl1_ssyr( uplo,
16 m,
17 alpha,
18 x, incx,
19 a, a_rs, a_cs );
20}
void bl1_ssyr(uplo1_t uplo, int m, float *alpha, float *x, int incx, float *a, int a_rs, int a_cs)
Definition bl1_syr.c:13

References bl1_ssyr().

◆ bl1_zher()

void bl1_zher ( uplo1_t  uplo,
conj1_t  conj,
int  m,
double alpha,
dcomplex x,
int  incx,
dcomplex a,
int  a_rs,
int  a_cs 
)
102{
103 int m_save = m;
104 dcomplex* a_save = a;
105 int a_rs_save = a_rs;
106 int a_cs_save = a_cs;
108 int incx_conj;
109 int lda, inca;
110
111 // Return early if possible.
112 if ( bl1_zero_dim1( m ) ) return;
113
114 // If necessary, allocate, initialize, and use a temporary contiguous
115 // copy of the matrix rather than the original matrix.
117 m,
118 m,
120 &a, &a_rs, &a_cs );
121
122 // Initialize with values assuming column-major storage.
123 lda = a_cs;
124 inca = a_rs;
125
126 // If A is a row-major matrix, then we can use the underlying column-major
127 // BLAS implementation by fiddling with the parameters.
128 if ( bl1_is_row_storage( a_rs, a_cs ) )
129 {
131 bl1_toggle_uplo( uplo );
133 }
134
135 // Initialize with values assuming no conjugation of ( x * x' ).
136 x_conj = x;
137 incx_conj = incx;
138
139 // We want to handle the case where ( x * x' ) is conjugated, but
140 // without explicitly conjugating the matrix. To do so, we leverage
141 // the fact that computing the product conj( x * x' ) is equivalent
142 // to computing ( conj(x) * conj(x)' ), since ( x * x' ) is Hermitian.
143 if ( bl1_is_conj( conj ) )
144 {
145 x_conj = bl1_zallocv( m );
146 incx_conj = 1;
147
149 m,
150 x, incx,
151 x_conj, incx_conj );
152 }
153
154 bl1_zher_blas( uplo,
155 m,
156 alpha,
158 a, lda );
159
160 // Free the temporary conjugated x vector.
161 if ( bl1_is_conj( conj ) )
162 bl1_zfree( x_conj );
163
164 // Free the temporary contiguous matrix.
166 m_save,
168 &a, &a_rs, &a_cs );
169}
void bl1_zcopyv(conj1_t conj, int m, dcomplex *x, int incx, dcomplex *y, int incy)
Definition bl1_copyv.c:63
void bl1_zher_blas(uplo1_t uplo, int m, double *alpha, dcomplex *x, int incx, dcomplex *a, int lda)
Definition bl1_her.c:200
dcomplex * bl1_zallocv(unsigned int n_elem)
Definition bl1_allocv.c:45
void bl1_zcreate_contigmr(uplo1_t uplo, int m, int n, dcomplex *a_save, int a_rs_save, int a_cs_save, dcomplex **a, int *a_rs, int *a_cs)
Definition bl1_create_contigmr.c:109
void bl1_zfree(dcomplex *p)
Definition bl1_free.c:45
void bl1_zfree_saved_contigm(int m, int n, dcomplex *a_save, int a_rs_save, int a_cs_save, dcomplex **a, int *a_rs, int *a_cs)
Definition bl1_free_saved_contigm.c:82
Definition blis_type_defs.h:138

References bl1_is_conj(), bl1_is_row_storage(), bl1_zallocv(), bl1_zcopyv(), bl1_zcreate_contigmr(), bl1_zero_dim1(), bl1_zfree(), bl1_zfree_saved_contigm(), bl1_zher_blas(), and BLIS1_CONJUGATE.

Referenced by FLA_Chol_l_opz_var3(), FLA_Chol_u_opz_var3(), FLA_Her_external(), FLA_Herc_external(), FLA_Ttmm_l_opz_var1(), and FLA_Ttmm_u_opz_var1().

◆ bl1_zher_blas()

void bl1_zher_blas ( uplo1_t  uplo,
int  m,
double alpha,
dcomplex x,
int  incx,
dcomplex a,
int  lda 
)
201{
202#ifdef BLIS1_ENABLE_CBLAS_INTERFACES
205
207
210 m,
211 *alpha,
212 x, incx,
213 a, lda );
214#else
215 char blas_uplo;
216
218
220 &m,
221 alpha,
222 x, &incx,
223 a, &lda );
224#endif
225}
void F77_zher(char *uplo, int *n, double *alpha, dcomplex *x, int *incx, dcomplex *a, int *lda)
void cblas_zher(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const int N, const double alpha, const void *X, const int incX, void *A, const int lda)

References bl1_param_map_to_netlib_uplo(), cblas_zher(), CblasColMajor, and F77_zher().

Referenced by bl1_zher().