libflame  revision_anchor
Functions
blis_prototypes_util.h File Reference

(r)

Go to the source code of this file.

Functions

float bl1_s2 (void)
 
double bl1_d2 (void)
 
scomplex bl1_c2 (void)
 
dcomplex bl1_z2 (void)
 
float bl1_s1 (void)
 
double bl1_d1 (void)
 
scomplex bl1_c1 (void)
 
dcomplex bl1_z1 (void)
 
float bl1_s1h (void)
 
double bl1_d1h (void)
 
scomplex bl1_c1h (void)
 
dcomplex bl1_z1h (void)
 
float bl1_s0 (void)
 
double bl1_d0 (void)
 
scomplex bl1_c0 (void)
 
dcomplex bl1_z0 (void)
 
float bl1_sm1h (void)
 
double bl1_dm1h (void)
 
scomplex bl1_cm1h (void)
 
dcomplex bl1_zm1h (void)
 
float bl1_sm1 (void)
 
double bl1_dm1 (void)
 
scomplex bl1_cm1 (void)
 
dcomplex bl1_zm1 (void)
 
float bl1_sm2 (void)
 
double bl1_dm2 (void)
 
scomplex bl1_cm2 (void)
 
dcomplex bl1_zm2 (void)
 
void * bl1_vallocv (unsigned int n_elem, unsigned int elem_size)
 
int * bl1_iallocv (unsigned int n_elem)
 
float * bl1_sallocv (unsigned int n_elem)
 
double * bl1_dallocv (unsigned int n_elem)
 
scomplexbl1_callocv (unsigned int n_elem)
 
dcomplexbl1_zallocv (unsigned int n_elem)
 
void * bl1_vallocm (unsigned int m, unsigned int n, unsigned int elem_size)
 
int * bl1_iallocm (unsigned int m, unsigned int n)
 
float * bl1_sallocm (unsigned int m, unsigned int n)
 
double * bl1_dallocm (unsigned int m, unsigned int n)
 
scomplexbl1_callocm (unsigned int m, unsigned int n)
 
dcomplexbl1_zallocm (unsigned int m, unsigned int n)
 
void bl1_sapdiagmv (side1_t side, conj1_t conj, int m, int n, float *x, int incx, float *a, int a_rs, int a_cs)
 
void bl1_dapdiagmv (side1_t side, conj1_t conj, int m, int n, double *x, int incx, double *a, int a_rs, int a_cs)
 
void bl1_csapdiagmv (side1_t side, conj1_t conj, int m, int n, float *x, int incx, scomplex *a, int a_rs, int a_cs)
 
void bl1_capdiagmv (side1_t side, conj1_t conj, int m, int n, scomplex *x, int incx, scomplex *a, int a_rs, int a_cs)
 
void bl1_zdapdiagmv (side1_t side, conj1_t conj, int m, int n, double *x, int incx, dcomplex *a, int a_rs, int a_cs)
 
void bl1_zapdiagmv (side1_t side, conj1_t conj, int m, int n, dcomplex *x, int incx, dcomplex *a, int a_rs, int a_cs)
 
void bl1_screate_contigm (int m, int n, float *a_save, int a_rs_save, int a_cs_save, float **a, int *a_rs, int *a_cs)
 
void bl1_dcreate_contigm (int m, int n, double *a_save, int a_rs_save, int a_cs_save, double **a, int *a_rs, int *a_cs)
 
void bl1_ccreate_contigm (int m, int n, scomplex *a_save, int a_rs_save, int a_cs_save, scomplex **a, int *a_rs, int *a_cs)
 
void bl1_zcreate_contigm (int m, int n, dcomplex *a_save, int a_rs_save, int a_cs_save, dcomplex **a, int *a_rs, int *a_cs)
 
void bl1_screate_contigmt (trans1_t trans_dims, int m, int n, float *a_save, int a_rs_save, int a_cs_save, float **a, int *a_rs, int *a_cs)
 
void bl1_dcreate_contigmt (trans1_t trans_dims, int m, int n, double *a_save, int a_rs_save, int a_cs_save, double **a, int *a_rs, int *a_cs)
 
void bl1_ccreate_contigmt (trans1_t trans_dims, int m, int n, scomplex *a_save, int a_rs_save, int a_cs_save, scomplex **a, int *a_rs, int *a_cs)
 
void bl1_zcreate_contigmt (trans1_t trans_dims, int m, int n, dcomplex *a_save, int a_rs_save, int a_cs_save, dcomplex **a, int *a_rs, int *a_cs)
 
void bl1_screate_contigmr (uplo1_t uplo, int m, int n, float *a_save, int a_rs_save, int a_cs_save, float **a, int *a_rs, int *a_cs)
 
void bl1_dcreate_contigmr (uplo1_t uplo, int m, int n, double *a_save, int a_rs_save, int a_cs_save, double **a, int *a_rs, int *a_cs)
 
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)
 
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)
 
void bl1_screate_contigmsr (side1_t side, uplo1_t uplo, int m, int n, float *a_save, int a_rs_save, int a_cs_save, float **a, int *a_rs, int *a_cs)
 
void bl1_dcreate_contigmsr (side1_t side, uplo1_t uplo, int m, int n, double *a_save, int a_rs_save, int a_cs_save, double **a, int *a_rs, int *a_cs)
 
void bl1_ccreate_contigmsr (side1_t side, 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)
 
void bl1_zcreate_contigmsr (side1_t side, 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)
 
void bl1_sfree_contigm (float *a_save, int a_rs_save, int a_cs_save, float **a, int *a_rs, int *a_cs)
 
void bl1_dfree_contigm (double *a_save, int a_rs_save, int a_cs_save, double **a, int *a_rs, int *a_cs)
 
void bl1_cfree_contigm (scomplex *a_save, int a_rs_save, int a_cs_save, scomplex **a, int *a_rs, int *a_cs)
 
void bl1_zfree_contigm (dcomplex *a_save, int a_rs_save, int a_cs_save, dcomplex **a, int *a_rs, int *a_cs)
 
void bl1_sfree_saved_contigm (int m, int n, float *a_save, int a_rs_save, int a_cs_save, float **a, int *a_rs, int *a_cs)
 
void bl1_dfree_saved_contigm (int m, int n, double *a_save, int a_rs_save, int a_cs_save, double **a, int *a_rs, int *a_cs)
 
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)
 
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)
 
void bl1_sfree_saved_contigmr (uplo1_t uplo, int m, int n, float *a_save, int a_rs_save, int a_cs_save, float **a, int *a_rs, int *a_cs)
 
void bl1_dfree_saved_contigmr (uplo1_t uplo, int m, int n, double *a_save, int a_rs_save, int a_cs_save, double **a, int *a_rs, int *a_cs)
 
void bl1_cfree_saved_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)
 
void bl1_zfree_saved_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)
 
void bl1_sfree_saved_contigmsr (side1_t side, uplo1_t uplo, int m, int n, float *a_save, int a_rs_save, int a_cs_save, float **a, int *a_rs, int *a_cs)
 
void bl1_dfree_saved_contigmsr (side1_t side, uplo1_t uplo, int m, int n, double *a_save, int a_rs_save, int a_cs_save, double **a, int *a_rs, int *a_cs)
 
void bl1_cfree_saved_contigmsr (side1_t side, 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)
 
void bl1_zfree_saved_contigmsr (side1_t side, 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)
 
void bl1_sewinvscalv (conj1_t conj, int n, float *x, int incx, float *y, int incy)
 
void bl1_dewinvscalv (conj1_t conj, int n, double *x, int incx, double *y, int incy)
 
void bl1_csewinvscalv (conj1_t conj, int n, float *x, int incx, scomplex *y, int incy)
 
void bl1_cewinvscalv (conj1_t conj, int n, scomplex *x, int incx, scomplex *y, int incy)
 
void bl1_zdewinvscalv (conj1_t conj, int n, double *x, int incx, dcomplex *y, int incy)
 
void bl1_zewinvscalv (conj1_t conj, int n, dcomplex *x, int incx, dcomplex *y, int incy)
 
void bl1_sewinvscalmt (trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
 
void bl1_dewinvscalmt (trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
 
void bl1_csewinvscalmt (trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
 
void bl1_cewinvscalmt (trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
 
void bl1_zdewinvscalmt (trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
 
void bl1_zewinvscalmt (trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
 
void bl1_sewscalv (conj1_t conj, int n, float *x, int incx, float *y, int incy)
 
void bl1_dewscalv (conj1_t conj, int n, double *x, int incx, double *y, int incy)
 
void bl1_csewscalv (conj1_t conj, int n, float *x, int incx, scomplex *y, int incy)
 
void bl1_cewscalv (conj1_t conj, int n, scomplex *x, int incx, scomplex *y, int incy)
 
void bl1_zdewscalv (conj1_t conj, int n, double *x, int incx, dcomplex *y, int incy)
 
void bl1_zewscalv (conj1_t conj, int n, dcomplex *x, int incx, dcomplex *y, int incy)
 
void bl1_sewscalmt (trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
 
void bl1_dewscalmt (trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
 
void bl1_csewscalmt (trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
 
void bl1_cewscalmt (trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
 
void bl1_zdewscalmt (trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
 
void bl1_zewscalmt (trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
 
void bl1_vfree (void *p)
 
void bl1_ifree (int *p)
 
void bl1_sfree (float *p)
 
void bl1_dfree (double *p)
 
void bl1_cfree (scomplex *p)
 
void bl1_zfree (dcomplex *p)
 
void bl1_sinverts (conj1_t conj, float *alpha)
 
void bl1_dinverts (conj1_t conj, double *alpha)
 
void bl1_cinverts (conj1_t conj, scomplex *alpha)
 
void bl1_zinverts (conj1_t conj, dcomplex *alpha)
 
void bl1_sinvert2s (conj1_t conj, float *alpha, float *beta)
 
void bl1_dinvert2s (conj1_t conj, double *alpha, double *beta)
 
void bl1_cinvert2s (conj1_t conj, scomplex *alpha, scomplex *beta)
 
void bl1_zinvert2s (conj1_t conj, dcomplex *alpha, dcomplex *beta)
 
void bl1_sinvertv (conj1_t conj, int n, float *x, int incx)
 
void bl1_dinvertv (conj1_t conj, int n, double *x, int incx)
 
void bl1_cinvertv (conj1_t conj, int n, scomplex *x, int incx)
 
void bl1_zinvertv (conj1_t conj, int n, dcomplex *x, int incx)
 
void bl1_sident (int m, float *a, int a_rs, int a_cs)
 
void bl1_dident (int m, double *a, int a_rs, int a_cs)
 
void bl1_cident (int m, scomplex *a, int a_rs, int a_cs)
 
void bl1_zident (int m, dcomplex *a, int a_rs, int a_cs)
 
void bl1_smaxabsv (int n, float *x, int incx, float *maxabs)
 
void bl1_dmaxabsv (int n, double *x, int incx, double *maxabs)
 
void bl1_cmaxabsv (int n, scomplex *x, int incx, float *maxabs)
 
void bl1_zmaxabsv (int n, dcomplex *x, int incx, double *maxabs)
 
void bl1_smaxabsm (int m, int n, float *a, int a_rs, int a_cs, float *maxabs)
 
void bl1_dmaxabsm (int m, int n, double *a, int a_rs, int a_cs, double *maxabs)
 
void bl1_cmaxabsm (int m, int n, scomplex *a, int a_rs, int a_cs, float *maxabs)
 
void bl1_zmaxabsm (int m, int n, dcomplex *a, int a_rs, int a_cs, double *maxabs)
 
void bl1_smaxabsmr (uplo1_t uplo, int m, int n, float *a, int a_rs, int a_cs, float *maxabs)
 
void bl1_dmaxabsmr (uplo1_t uplo, int m, int n, double *a, int a_rs, int a_cs, double *maxabs)
 
void bl1_cmaxabsmr (uplo1_t uplo, int m, int n, scomplex *a, int a_rs, int a_cs, float *maxabs)
 
void bl1_zmaxabsmr (uplo1_t uplo, int m, int n, dcomplex *a, int a_rs, int a_cs, double *maxabs)
 
void bl1_srands (float *alpha)
 
void bl1_drands (double *alpha)
 
void bl1_crands (scomplex *alpha)
 
void bl1_zrands (dcomplex *alpha)
 
void bl1_srandv (int n, float *x, int incx)
 
void bl1_drandv (int n, double *x, int incx)
 
void bl1_crandv (int n, scomplex *x, int incx)
 
void bl1_zrandv (int n, dcomplex *x, int incx)
 
void bl1_srandm (int m, int n, float *a, int a_rs, int a_cs)
 
void bl1_drandm (int m, int n, double *a, int a_rs, int a_cs)
 
void bl1_crandm (int m, int n, scomplex *a, int a_rs, int a_cs)
 
void bl1_zrandm (int m, int n, dcomplex *a, int a_rs, int a_cs)
 
void bl1_srandmr (uplo1_t uplo, diag1_t diag, int m, int n, float *a, int a_rs, int a_cs)
 
void bl1_drandmr (uplo1_t uplo, diag1_t diag, int m, int n, double *a, int a_rs, int a_cs)
 
void bl1_crandmr (uplo1_t uplo, diag1_t diag, int m, int n, scomplex *a, int a_rs, int a_cs)
 
void bl1_zrandmr (uplo1_t uplo, diag1_t diag, int m, int n, dcomplex *a, int a_rs, int a_cs)
 
void bl1_set_contig_strides (int m, int n, int *rs, int *cs)
 
void bl1_set_dim_with_side (side1_t side, int m, int n, int *dim_new)
 
void bl1_set_dims_with_trans (trans1_t trans, int m, int n, int *m_new, int *n_new)
 
void bl1_isetv (int m, int *sigma, int *x, int incx)
 
void bl1_ssetv (int m, float *sigma, float *x, int incx)
 
void bl1_dsetv (int m, double *sigma, double *x, int incx)
 
void bl1_csetv (int m, scomplex *sigma, scomplex *x, int incx)
 
void bl1_zsetv (int m, dcomplex *sigma, dcomplex *x, int incx)
 
void bl1_isetm (int m, int n, int *sigma, int *a, int a_rs, int a_cs)
 
void bl1_ssetm (int m, int n, float *sigma, float *a, int a_rs, int a_cs)
 
void bl1_dsetm (int m, int n, double *sigma, double *a, int a_rs, int a_cs)
 
void bl1_csetm (int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
 
void bl1_zsetm (int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
 
void bl1_ssetmr (uplo1_t uplo, int m, int n, float *sigma, float *a, int a_rs, int a_cs)
 
void bl1_dsetmr (uplo1_t uplo, int m, int n, double *sigma, double *a, int a_rs, int a_cs)
 
void bl1_csetmr (uplo1_t uplo, int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
 
void bl1_zsetmr (uplo1_t uplo, int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
 
void bl1_isetdiag (int offset, int m, int n, int *sigma, int *a, int a_rs, int a_cs)
 
void bl1_ssetdiag (int offset, int m, int n, float *sigma, float *a, int a_rs, int a_cs)
 
void bl1_dsetdiag (int offset, int m, int n, double *sigma, double *a, int a_rs, int a_cs)
 
void bl1_csetdiag (int offset, int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
 
void bl1_zsetdiag (int offset, int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
 
void bl1_sscalediag (conj1_t conj, int offset, int m, int n, float *sigma, float *a, int a_rs, int a_cs)
 
void bl1_dscalediag (conj1_t conj, int offset, int m, int n, double *sigma, double *a, int a_rs, int a_cs)
 
void bl1_cscalediag (conj1_t conj, int offset, int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
 
void bl1_zscalediag (conj1_t conj, int offset, int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
 
void bl1_csscalediag (conj1_t conj, int offset, int m, int n, float *sigma, scomplex *a, int a_rs, int a_cs)
 
void bl1_zdscalediag (conj1_t conj, int offset, int m, int n, double *sigma, dcomplex *a, int a_rs, int a_cs)
 
void bl1_sshiftdiag (conj1_t conj, int offset, int m, int n, float *sigma, float *a, int a_rs, int a_cs)
 
void bl1_dshiftdiag (conj1_t conj, int offset, int m, int n, double *sigma, double *a, int a_rs, int a_cs)
 
void bl1_cshiftdiag (conj1_t conj, int offset, int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
 
void bl1_zshiftdiag (conj1_t conj, int offset, int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
 
void bl1_csshiftdiag (conj1_t conj, int offset, int m, int n, float *sigma, scomplex *a, int a_rs, int a_cs)
 
void bl1_zdshiftdiag (conj1_t conj, int offset, int m, int n, double *sigma, dcomplex *a, int a_rs, int a_cs)
 
void bl1_ssymmize (conj1_t conj, uplo1_t uplo, int m, float *a, int a_rs, int a_cs)
 
void bl1_dsymmize (conj1_t conj, uplo1_t uplo, int m, double *a, int a_rs, int a_cs)
 
void bl1_csymmize (conj1_t conj, uplo1_t uplo, int m, scomplex *a, int a_rs, int a_cs)
 
void bl1_zsymmize (conj1_t conj, uplo1_t uplo, int m, dcomplex *a, int a_rs, int a_cs)
 

Function Documentation

◆ bl1_c0()

scomplex bl1_c0 ( void  )

References bl1_s0(), scomplex::imag, and scomplex::real.

Referenced by bl1_cgemm(), bl1_cgemv(), bl1_chemm(), bl1_chemv(), bl1_crandmr(), bl1_csymm(), FLA_QR_UT_form_Q_opc_var1(), and FLA_Tridiag_UT_shift_U_l_opc().

126 {
127  scomplex x;
128  x.real = bl1_s0();
129  x.imag = bl1_s0();
130  return x;
131 }
float real
Definition: blis_type_defs.h:134
float bl1_s0(void)
Definition: bl1_constants.c:111
Definition: blis_type_defs.h:132
float imag
Definition: blis_type_defs.h:134

◆ bl1_c1()

scomplex bl1_c1 ( void  )

References bl1_s0(), bl1_s1(), scomplex::imag, and scomplex::real.

Referenced by bl1_cgemm(), bl1_cgemv(), bl1_chemm(), bl1_chemv(), bl1_cher2k(), bl1_cherk(), bl1_crandmr(), bl1_csymm(), bl1_ctrmmsx(), bl1_ctrsmsx(), FLA_Bsvd_ext_opc_var1(), FLA_Bsvd_ext_ops_var1(), FLA_Bsvd_v_opc_var1(), FLA_Bsvd_v_ops_var1(), FLA_QR_UT_form_Q_opc_var1(), and FLA_Tridiag_UT_shift_U_l_opc().

62 {
63  scomplex x;
64  x.real = bl1_s1();
65  x.imag = bl1_s0();
66  return x;
67 }
float real
Definition: blis_type_defs.h:134
float bl1_s1(void)
Definition: bl1_constants.c:47
float bl1_s0(void)
Definition: bl1_constants.c:111
Definition: blis_type_defs.h:132
float imag
Definition: blis_type_defs.h:134

◆ bl1_c1h()

scomplex bl1_c1h ( void  )

References bl1_s0(), bl1_s1h(), scomplex::imag, and scomplex::real.

94 {
95  scomplex x;
96  x.real = bl1_s1h();
97  x.imag = bl1_s0();
98  return x;
99 }
float real
Definition: blis_type_defs.h:134
float bl1_s1h(void)
Definition: bl1_constants.c:79
float bl1_s0(void)
Definition: bl1_constants.c:111
Definition: blis_type_defs.h:132
float imag
Definition: blis_type_defs.h:134

◆ bl1_c2()

scomplex bl1_c2 ( void  )

References bl1_s0(), bl1_s2(), scomplex::imag, and scomplex::real.

30 {
31  scomplex x;
32  x.real = bl1_s2();
33  x.imag = bl1_s0();
34  return x;
35 }
float real
Definition: blis_type_defs.h:134
float bl1_s0(void)
Definition: bl1_constants.c:111
Definition: blis_type_defs.h:132
float imag
Definition: blis_type_defs.h:134
float bl1_s2(void)
Definition: bl1_constants.c:15

◆ bl1_callocm()

scomplex* bl1_callocm ( unsigned int  m,
unsigned int  n 
)

Referenced by bl1_ccreate_contigm(), bl1_ccreate_contigmr(), bl1_ccreate_contigmt(), bl1_cgemm(), bl1_chemm(), bl1_cher2k(), bl1_cherk(), bl1_csymm(), bl1_csyr2k(), bl1_ctrmm(), bl1_ctrmmsx(), bl1_ctrsm(), and bl1_ctrsmsx().

41 {
42  return ( scomplex* ) BLIS1_MALLOC( m * n * sizeof( scomplex ) );
43 }
Definition: blis_type_defs.h:132

◆ bl1_callocv()

scomplex* bl1_callocv ( unsigned int  n_elem)

Referenced by bl1_caxpymt(), bl1_caxpysmt(), bl1_caxpyv(), bl1_cgemv(), bl1_cger(), bl1_chemv(), bl1_cher(), bl1_cher2(), bl1_csymv_blas(), bl1_csyr2_blas(), bl1_csyr_blas(), bl1_ctrmv(), bl1_ctrmvsx(), bl1_ctrsv(), and bl1_ctrsvsx().

41 {
42  return ( scomplex* ) BLIS1_MALLOC( n_elem * sizeof( scomplex ) );
43 }
Definition: blis_type_defs.h:132

◆ bl1_capdiagmv()

void bl1_capdiagmv ( side1_t  side,
conj1_t  conj,
int  m,
int  n,
scomplex x,
int  incx,
scomplex a,
int  a_rs,
int  a_cs 
)

References bl1_cewscalv(), bl1_cscalv(), bl1_is_left(), bl1_is_row_storage(), and bl1_zero_dim2().

Referenced by FLA_Apply_diag_matrix().

179 {
180  scomplex* chi;
181  scomplex* a_begin;
182  int inca, lda;
183  int n_iter;
184  int n_elem;
185  int j;
186 
187  // Return early if possible.
188  if ( bl1_zero_dim2( m, n ) ) return;
189 
190  // Initialize with optimal values for column-major storage.
191  inca = a_rs;
192  lda = a_cs;
193  n_iter = n;
194  n_elem = m;
195 
196  // An optimization: if A is row-major, then we can proceed as if the
197  // operation were transposed (applying the diagonal values in x from the
198  // opposite side) for increased spatial locality.
199  if ( bl1_is_row_storage( a_rs, a_cs ) )
200  {
201  bl1_swap_ints( n_iter, n_elem );
202  bl1_swap_ints( lda, inca );
203  bl1_toggle_side( side );
204  }
205 
206  if ( bl1_is_left( side ) )
207  {
208  for ( j = 0; j < n_iter; j++ )
209  {
210  a_begin = a + j*lda;
211 
212  bl1_cewscalv( conj,
213  n_elem,
214  x, incx,
215  a_begin, inca );
216  }
217  }
218  else
219  {
220  for ( j = 0; j < n_iter; j++ )
221  {
222  a_begin = a + j*lda;
223  chi = x + j*incx;
224 
225  bl1_cscalv( conj,
226  n_elem,
227  chi,
228  a_begin, inca );
229  }
230  }
231 }
void bl1_cscalv(conj1_t conj, int n, scomplex *alpha, scomplex *x, int incx)
Definition: bl1_scalv.c:46
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_cewscalv(conj1_t conj, int n, scomplex *x, int incx, scomplex *y, int incy)
Definition: bl1_ewscalv.c:58
Definition: blis_type_defs.h:132

◆ bl1_ccreate_contigm()

void bl1_ccreate_contigm ( int  m,
int  n,
scomplex a_save,
int  a_rs_save,
int  a_cs_save,
scomplex **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_callocm(), bl1_ccopymt(), bl1_is_gen_storage(), bl1_set_contig_strides(), and BLIS1_NO_TRANSPOSE.

Referenced by bl1_cgemm(), bl1_cgemv(), bl1_cger(), bl1_chemm(), bl1_csymm(), bl1_ctrmm(), bl1_ctrmmsx(), bl1_ctrsm(), and bl1_ctrsmsx().

82 {
83  int m_contig, n_contig;
84 
85  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
86  {
87  // Initialize dimensions assuming no transposition needed during copy.
88  m_contig = m;
89  n_contig = n;
90 
91 /*
92  // Transpose the dimensions of the contiguous matrix, if requested.
93  if ( bl1_does_trans( trans_copy ) )
94  {
95  m_contig = n;
96  n_contig = m;
97  }
98 */
99 
100  // Allocate temporary contiguous storage for the matrix.
101  *a = bl1_callocm( m_contig, n_contig );
102 
103  // Set the row and column strides for the temporary matrix.
104  bl1_set_contig_strides( m_contig, n_contig, a_rs, a_cs );
105 
106  // Initialize the contiguous matrix with the contents of the original.
108  m_contig,
109  n_contig,
110  a_save, a_rs_save, a_cs_save,
111  *a, *a_rs, *a_cs );
112  }
113 }
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
Definition: blis_type_defs.h:54
void bl1_ccopymt(trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:215
scomplex * bl1_callocm(unsigned int m, unsigned int n)
Definition: bl1_allocm.c:40
void bl1_set_contig_strides(int m, int n, int *rs, int *cs)
Definition: bl1_set_contig_strides.c:13

◆ bl1_ccreate_contigmr()

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 
)

References bl1_callocm(), bl1_ccopymr(), bl1_is_gen_storage(), and bl1_set_contig_strides().

Referenced by bl1_ccreate_contigmsr(), bl1_chemm(), bl1_chemv(), bl1_cher(), bl1_cher2(), bl1_cher2k(), bl1_cherk(), bl1_csymm(), bl1_csymv(), bl1_csyr(), bl1_csyr2(), bl1_csyr2k(), bl1_csyrk(), bl1_ctrmm(), bl1_ctrmmsx(), bl1_ctrmv(), bl1_ctrmvsx(), bl1_ctrsm(), bl1_ctrsmsx(), bl1_ctrsv(), and bl1_ctrsvsx().

78 {
79  int m_contig, n_contig;
80 
81  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
82  {
83  // Initialize dimensions assuming no transposition needed during copy.
84  m_contig = m;
85  n_contig = n;
86 /*
87  // Transpose the dimensions of the contiguous matrix, if requested.
88  if ( bl1_does_trans( trans_copy ) )
89  {
90  m_contig = n;
91  n_contig = m;
92  }
93 */
94  // Allocate temporary contiguous storage for the matrix.
95  *a = bl1_callocm( m_contig, n_contig );
96 
97  // Set the row and column strides for the temporary matrix.
98  bl1_set_contig_strides( m_contig, n_contig, a_rs, a_cs );
99 
100  // Initialize the contiguous matrix with the contents of the original.
101  bl1_ccopymr( uplo,
102  m_contig,
103  n_contig,
104  a_save, a_rs_save, a_cs_save,
105  *a, *a_rs, *a_cs );
106  }
107 }
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
scomplex * bl1_callocm(unsigned int m, unsigned int n)
Definition: bl1_allocm.c:40
void bl1_ccopymr(uplo1_t uplo, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:139
void bl1_set_contig_strides(int m, int n, int *rs, int *cs)
Definition: bl1_set_contig_strides.c:13

◆ bl1_ccreate_contigmsr()

void bl1_ccreate_contigmsr ( side1_t  side,
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 
)

References bl1_ccreate_contigmr(), and bl1_is_left().

46 {
47  int dim_a;
48 
49  // Choose the dimension of the matrix based on the side parameter.
50  if ( bl1_is_left( side ) ) dim_a = m;
51  else dim_a = n;
52 
53  // Call the simple version with chosen dimensions.
55  dim_a,
56  dim_a,
57  a_save, a_rs_save, a_cs_save,
58  a, a_rs, a_cs );
59 }
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61
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

◆ bl1_ccreate_contigmt()

void bl1_ccreate_contigmt ( trans1_t  trans_dims,
int  m,
int  n,
scomplex a_save,
int  a_rs_save,
int  a_cs_save,
scomplex **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_callocm(), bl1_ccopymt(), bl1_does_trans(), bl1_is_gen_storage(), bl1_set_contig_strides(), and BLIS1_NO_TRANSPOSE.

Referenced by bl1_cgemm(), bl1_cher2k(), bl1_cherk(), bl1_csyr2k(), and bl1_csyrk().

90 {
91  int m_contig, n_contig;
92 
93  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
94  {
95  // Transpose the dimensions if requested.
96  if ( bl1_does_trans( trans_dims ) )
97  bl1_swap_ints( m, n );
98 
99  // Initialize dimensions assuming no transposition needed during copy.
100  m_contig = m;
101  n_contig = n;
102 
103 /*
104  // Transpose the dimensions of the contiguous matrix, if requested.
105  if ( bl1_does_trans( trans_copy ) )
106  {
107  m_contig = n;
108  n_contig = m;
109  }
110 */
111 
112  // Allocate temporary contiguous storage for the matrix.
113  *a = bl1_callocm( m_contig, n_contig );
114 
115  // Set the row and column strides for the temporary matrix.
116  bl1_set_contig_strides( m_contig, n_contig, a_rs, a_cs );
117 
118  // Initialize the contiguous matrix with the contents of the original.
120  m_contig,
121  n_contig,
122  a_save, a_rs_save, a_cs_save,
123  *a, *a_rs, *a_cs );
124  }
125 }
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
Definition: blis_type_defs.h:54
void bl1_ccopymt(trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:215
scomplex * bl1_callocm(unsigned int m, unsigned int n)
Definition: bl1_allocm.c:40
void bl1_set_contig_strides(int m, int n, int *rs, int *cs)
Definition: bl1_set_contig_strides.c:13
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13

◆ bl1_cewinvscalmt()

void bl1_cewinvscalmt ( trans1_t  trans,
int  m,
int  n,
scomplex a,
int  a_rs,
int  a_cs,
scomplex b,
int  b_rs,
int  b_cs 
)

References bl1_cewinvscalv(), bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

Referenced by FLA_Inv_scal_elemwise().

230 {
231  scomplex* a_begin;
232  scomplex* b_begin;
233  int lda, inca;
234  int ldb, incb;
235  int n_iter;
236  int n_elem;
237  int j;
238  conj1_t conj;
239 
240  // Return early if possible.
241  if ( bl1_zero_dim2( m, n ) ) return;
242 
243  // Handle cases where A and B are vectors to ensure that the underlying ewinvscal
244  // gets invoked only once.
245  if ( bl1_is_vector( m, n ) )
246  {
247  // Initialize with values appropriate for vectors.
248  n_iter = 1;
249  n_elem = bl1_vector_dim( m, n );
250  lda = 1; // multiplied by zero when n_iter == 1; not needed.
251  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
252  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
253  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
254  }
255  else // matrix case
256  {
257  // Initialize with optimal values for column-major storage.
258  n_iter = n;
259  n_elem = m;
260  lda = a_cs;
261  inca = a_rs;
262  ldb = b_cs;
263  incb = b_rs;
264 
265  // Handle the transposition of A.
266  if ( bl1_does_trans( trans ) )
267  {
268  bl1_swap_ints( lda, inca );
269  }
270 
271  // An optimization: if B is row-major and if A is effectively row-major
272  // after a possible transposition, then let's access the matrices by rows
273  // instead of by columns for increased spatial locality.
274  if ( bl1_is_row_storage( b_rs, b_cs ) )
275  {
276  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
277  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
278  {
279  bl1_swap_ints( n_iter, n_elem );
280  bl1_swap_ints( lda, inca );
281  bl1_swap_ints( ldb, incb );
282  }
283  }
284  }
285 
286  // Extract conj component from trans parameter.
287  conj = bl1_proj_trans1_to_conj( trans );
288 
289  for ( j = 0; j < n_iter; j++ )
290  {
291  a_begin = a + j*lda;
292  b_begin = b + j*ldb;
293 
294  bl1_cewinvscalv( conj,
295  n_elem,
296  a_begin, inca,
297  b_begin, incb );
298  }
299 }
int bl1_vector_dim(int m, int n)
Definition: bl1_vector.c:13
conj1_t
Definition: blis_type_defs.h:79
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_does_notrans(trans1_t trans)
Definition: bl1_does.c:19
int bl1_vector_inc(trans1_t trans, int m, int n, int rs, int cs)
Definition: bl1_vector.c:19
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
void bl1_cewinvscalv(conj1_t conj, int n, scomplex *x, int incx, scomplex *y, int incy)
Definition: bl1_ewinvscalv.c:58
Definition: blis_type_defs.h:54
Definition: blis_type_defs.h:132
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition: bl1_proj.c:13
int bl1_is_vector(int m, int n)
Definition: bl1_is.c:106
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13

◆ bl1_cewinvscalv()

void bl1_cewinvscalv ( conj1_t  conj,
int  n,
scomplex x,
int  incx,
scomplex y,
int  incy 
)

References bl1_is_conj(), and i.

Referenced by bl1_cewinvscalmt().

59 {
60  scomplex* chi;
61  scomplex* psi;
62  scomplex conjchi;
63  int i;
64 
65  if ( bl1_is_conj( conj ) )
66  {
67  for ( i = 0; i < n; ++i )
68  {
69  chi = x + i*incx;
70  psi = y + i*incy;
71 
72  bl1_ccopyconj( chi, &conjchi );
73  bl1_cinvscals( &conjchi, psi );
74  }
75  }
76  else
77  {
78  for ( i = 0; i < n; ++i )
79  {
80  chi = x + i*incx;
81  psi = y + i*incy;
82 
83  bl1_cinvscals( chi, psi );
84  }
85  }
86 }
int bl1_is_conj(conj1_t conj)
Definition: bl1_is.c:42
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145

◆ bl1_cewscalmt()

void bl1_cewscalmt ( trans1_t  trans,
int  m,
int  n,
scomplex a,
int  a_rs,
int  a_cs,
scomplex b,
int  b_rs,
int  b_cs 
)

References bl1_cewscalv(), bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

Referenced by FLA_Scal_elemwise().

230 {
231  scomplex* a_begin;
232  scomplex* b_begin;
233  int lda, inca;
234  int ldb, incb;
235  int n_iter;
236  int n_elem;
237  int j;
238  conj1_t conj;
239 
240  // Return early if possible.
241  if ( bl1_zero_dim2( m, n ) ) return;
242 
243  // Handle cases where A and B are vectors to ensure that the underlying ewscal
244  // gets invoked only once.
245  if ( bl1_is_vector( m, n ) )
246  {
247  // Initialize with values appropriate for vectors.
248  n_iter = 1;
249  n_elem = bl1_vector_dim( m, n );
250  lda = 1; // multiplied by zero when n_iter == 1; not needed.
251  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
252  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
253  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
254  }
255  else // matrix case
256  {
257  // Initialize with optimal values for column-major storage.
258  n_iter = n;
259  n_elem = m;
260  lda = a_cs;
261  inca = a_rs;
262  ldb = b_cs;
263  incb = b_rs;
264 
265  // Handle the transposition of A.
266  if ( bl1_does_trans( trans ) )
267  {
268  bl1_swap_ints( lda, inca );
269  }
270 
271  // An optimization: if B is row-major and if A is effectively row-major
272  // after a possible transposition, then let's access the matrices by rows
273  // instead of by columns for increased spatial locality.
274  if ( bl1_is_row_storage( b_rs, b_cs ) )
275  {
276  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
277  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
278  {
279  bl1_swap_ints( n_iter, n_elem );
280  bl1_swap_ints( lda, inca );
281  bl1_swap_ints( ldb, incb );
282  }
283  }
284  }
285 
286  // Extract conj component from trans parameter.
287  conj = bl1_proj_trans1_to_conj( trans );
288 
289  for ( j = 0; j < n_iter; j++ )
290  {
291  a_begin = a + j*lda;
292  b_begin = b + j*ldb;
293 
294  bl1_cewscalv( conj,
295  n_elem,
296  a_begin, inca,
297  b_begin, incb );
298  }
299 }
int bl1_vector_dim(int m, int n)
Definition: bl1_vector.c:13
conj1_t
Definition: blis_type_defs.h:79
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_does_notrans(trans1_t trans)
Definition: bl1_does.c:19
int bl1_vector_inc(trans1_t trans, int m, int n, int rs, int cs)
Definition: bl1_vector.c:19
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
Definition: blis_type_defs.h:54
void bl1_cewscalv(conj1_t conj, int n, scomplex *x, int incx, scomplex *y, int incy)
Definition: bl1_ewscalv.c:58
Definition: blis_type_defs.h:132
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition: bl1_proj.c:13
int bl1_is_vector(int m, int n)
Definition: bl1_is.c:106
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13

◆ bl1_cewscalv()

void bl1_cewscalv ( conj1_t  conj,
int  n,
scomplex x,
int  incx,
scomplex y,
int  incy 
)

References bl1_is_conj(), and i.

Referenced by bl1_capdiagmv(), and bl1_cewscalmt().

59 {
60  scomplex* chi;
61  scomplex* psi;
62  scomplex conjchi;
63  int i;
64 
65  if ( bl1_is_conj( conj ) )
66  {
67  for ( i = 0; i < n; ++i )
68  {
69  chi = x + i*incx;
70  psi = y + i*incy;
71 
72  bl1_ccopyconj( chi, &conjchi );
73  bl1_cscals( &conjchi, psi );
74  }
75  }
76  else
77  {
78  for ( i = 0; i < n; ++i )
79  {
80  chi = x + i*incx;
81  psi = y + i*incy;
82 
83  bl1_cscals( chi, psi );
84  }
85  }
86 }
int bl1_is_conj(conj1_t conj)
Definition: bl1_is.c:42
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145

◆ bl1_cfree()

void bl1_cfree ( scomplex p)

◆ bl1_cfree_contigm()

void bl1_cfree_contigm ( scomplex a_save,
int  a_rs_save,
int  a_cs_save,
scomplex **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_cfree(), and bl1_is_gen_storage().

Referenced by bl1_cgemm(), bl1_cgemv(), bl1_chemm(), bl1_chemv(), bl1_cher2k(), bl1_cherk(), bl1_csymm(), bl1_csymv(), bl1_csyr2k(), bl1_csyrk(), bl1_ctrmm(), bl1_ctrmmsx(), bl1_ctrmv(), bl1_ctrmvsx(), bl1_ctrsm(), bl1_ctrsmsx(), bl1_ctrsv(), and bl1_ctrsvsx().

46 {
47  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
48  {
49  // Free the temporary contiguous storage for the matrix.
50  bl1_cfree( *a );
51 
52  // Restore the original matrix address.
53  *a = a_save;
54 
55  // Restore the original row and column strides.
56  *a_rs = a_rs_save;
57  *a_cs = a_cs_save;
58  }
59 }
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
void bl1_cfree(scomplex *p)
Definition: bl1_free.c:40

◆ bl1_cfree_saved_contigm()

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 
)

References bl1_ccopymt(), bl1_cfree(), bl1_is_gen_storage(), and BLIS1_NO_TRANSPOSE.

Referenced by bl1_cgemm(), bl1_cger(), bl1_chemm(), bl1_cher(), bl1_cher2(), bl1_csymm(), bl1_csyr(), bl1_csyr2(), bl1_ctrmm(), bl1_ctrmmsx(), bl1_ctrsm(), and bl1_ctrsmsx().

60 {
61  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
62  {
63  // Copy the contents of the temporary matrix back to the original.
65  m,
66  n,
67  *a, *a_rs, *a_cs,
68  a_save, a_rs_save, a_cs_save );
69 
70  // Free the temporary contiguous storage for the matrix.
71  bl1_cfree( *a );
72 
73  // Restore the original matrix address.
74  *a = a_save;
75 
76  // Restore the original row and column strides.
77  *a_rs = a_rs_save;
78  *a_cs = a_cs_save;
79  }
80 }
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
Definition: blis_type_defs.h:54
void bl1_ccopymt(trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:215
void bl1_cfree(scomplex *p)
Definition: bl1_free.c:40

◆ bl1_cfree_saved_contigmr()

void bl1_cfree_saved_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 
)

References bl1_ccopymr(), bl1_cfree(), and bl1_is_gen_storage().

Referenced by bl1_cher2k(), bl1_cherk(), bl1_csyr2k(), and bl1_csyrk().

60 {
61  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
62  {
63  // Copy the contents of the temporary matrix back to the original.
64  bl1_ccopymr( uplo,
65  m,
66  n,
67  *a, *a_rs, *a_cs,
68  a_save, a_rs_save, a_cs_save );
69 
70  // Free the temporary contiguous storage for the matrix.
71  bl1_cfree( *a );
72 
73  // Restore the original matrix address.
74  *a = a_save;
75 
76  // Restore the original row and column strides.
77  *a_rs = a_rs_save;
78  *a_cs = a_cs_save;
79  }
80 }
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
void bl1_cfree(scomplex *p)
Definition: bl1_free.c:40
void bl1_ccopymr(uplo1_t uplo, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:139

◆ bl1_cfree_saved_contigmsr()

void bl1_cfree_saved_contigmsr ( side1_t  side,
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 
)

References bl1_ccopymt(), bl1_cfree(), bl1_is_gen_storage(), and bl1_is_left().

72 {
73  int dim_a;
74 
75  // Choose the dimension of the matrix based on the side parameter.
76  if ( bl1_is_left( side ) ) dim_a = m;
77  else dim_a = n;
78 
79  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
80  {
81  // Copy the contents of the temporary matrix back to the original.
82  bl1_ccopymt( uplo,
83  dim_a,
84  dim_a,
85  *a, *a_rs, *a_cs,
86  a_save, a_rs_save, a_cs_save );
87 
88  // Free the temporary contiguous storage for the matrix.
89  bl1_cfree( *a );
90 
91  // Restore the original matrix address.
92  *a = a_save;
93 
94  // Restore the original row and column strides.
95  *a_rs = a_rs_save;
96  *a_cs = a_cs_save;
97  }
98 }
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
void bl1_ccopymt(trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:215
void bl1_cfree(scomplex *p)
Definition: bl1_free.c:40

◆ bl1_cident()

void bl1_cident ( int  m,
scomplex a,
int  a_rs,
int  a_cs 
)

References i, scomplex::imag, and scomplex::real.

Referenced by FLA_UDdate_UT_opc_var1().

52 {
53  scomplex* alpha;
54  int i, j;
55 
56  for ( j = 0; j < m; ++j )
57  {
58  for ( i = 0; i < m; ++i )
59  {
60  alpha = a + i*a_rs + j*a_cs;
61 
62  alpha->real = 0.0F;
63  alpha->imag = 0.0F;
64 
65  if ( i == j )
66  alpha->real = 1.0F;
67  }
68  }
69 }
float real
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145
float imag
Definition: blis_type_defs.h:134

◆ bl1_cinvert2s()

void bl1_cinvert2s ( conj1_t  conj,
scomplex alpha,
scomplex beta 
)

References bl1_is_conj(), scomplex::imag, scomplex::real, and temp.

Referenced by bl1_cinvscalm(), and bl1_cinvscalv().

28 {
29  float temp;
30  float s, xr_s, xi_s;
31 
32  s = bl1_fmaxabs( alpha->real, alpha->imag ); \
33  xr_s = alpha->real / s;
34  xi_s = alpha->imag / s;
35  temp = xr_s * alpha->real + xi_s * alpha->imag;
36 
37  beta->real = xr_s / temp;
38  beta->imag = -xi_s / temp;
39 
40  if ( bl1_is_conj( conj ) )
41  bl1_cconjs( beta );
42 }
float real
Definition: blis_type_defs.h:134
int bl1_is_conj(conj1_t conj)
Definition: bl1_is.c:42
dcomplex temp
Definition: bl1_axpyv2b.c:301
float imag
Definition: blis_type_defs.h:134

◆ bl1_cinverts()

void bl1_cinverts ( conj1_t  conj,
scomplex alpha 
)

References bl1_is_conj(), scomplex::imag, scomplex::real, and temp.

Referenced by FLA_Trinv_ln_opc_var1(), FLA_Trinv_ln_opc_var2(), FLA_Trinv_ln_opc_var3(), FLA_Trinv_ln_opc_var4(), FLA_Trinv_un_opc_var1(), FLA_Trinv_un_opc_var2(), FLA_Trinv_un_opc_var3(), and FLA_Trinv_un_opc_var4().

28 {
29  float temp;
30  float s, xr_s, xi_s;
31 
32  s = bl1_fmaxabs( alpha->real, alpha->imag ); \
33  xr_s = alpha->real / s;
34  xi_s = alpha->imag / s;
35  temp = xr_s * alpha->real + xi_s * alpha->imag;
36 
37  alpha->real = xr_s / temp;
38  alpha->imag = -xi_s / temp;
39 
40  if ( bl1_is_conj( conj ) )
41  bl1_cconjs( alpha );
42 }
float real
Definition: blis_type_defs.h:134
int bl1_is_conj(conj1_t conj)
Definition: bl1_is.c:42
dcomplex temp
Definition: bl1_axpyv2b.c:301
float imag
Definition: blis_type_defs.h:134

◆ bl1_cinvertv()

void bl1_cinvertv ( conj1_t  conj,
int  n,
scomplex x,
int  incx 
)

References bl1_is_conj(), i, scomplex::imag, scomplex::real, and temp.

Referenced by FLA_Invert().

42 {
43  float one = 1.0F;
44  float temp;
45  float s, xr_s, xi_s;
46  float conjsign;
47  scomplex* chi;
48  int i;
49 
50  if ( bl1_is_conj( conj ) ) conjsign = one;
51  else conjsign = -one;
52 
53  for ( i = 0; i < n; ++i )
54  {
55  chi = x + i*incx;
56 
57  s = bl1_fmaxabs( chi->real, chi->imag ); \
58  xr_s = chi->real / s;
59  xi_s = chi->imag / s;
60  temp = xr_s * chi->real + xi_s * chi->imag;
61 
62  chi->real = xr_s / temp;
63  chi->imag = conjsign * xi_s / temp;
64  }
65 }
float real
Definition: blis_type_defs.h:134
int bl1_is_conj(conj1_t conj)
Definition: bl1_is.c:42
dcomplex temp
Definition: bl1_axpyv2b.c:301
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145
float imag
Definition: blis_type_defs.h:134

◆ bl1_cm1()

scomplex bl1_cm1 ( void  )

References bl1_s0(), bl1_sm1(), scomplex::imag, and scomplex::real.

190 {
191  scomplex x;
192  x.real = bl1_sm1();
193  x.imag = bl1_s0();
194  return x;
195 }
float real
Definition: blis_type_defs.h:134
float bl1_s0(void)
Definition: bl1_constants.c:111
Definition: blis_type_defs.h:132
float bl1_sm1(void)
Definition: bl1_constants.c:175
float imag
Definition: blis_type_defs.h:134

◆ bl1_cm1h()

scomplex bl1_cm1h ( void  )

References bl1_s0(), bl1_sm1h(), scomplex::imag, and scomplex::real.

158 {
159  scomplex x;
160  x.real = bl1_sm1h();
161  x.imag = bl1_s0();
162  return x;
163 }
float real
Definition: blis_type_defs.h:134
float bl1_s0(void)
Definition: bl1_constants.c:111
Definition: blis_type_defs.h:132
float bl1_sm1h(void)
Definition: bl1_constants.c:143
float imag
Definition: blis_type_defs.h:134

◆ bl1_cm2()

scomplex bl1_cm2 ( void  )

References bl1_s0(), bl1_sm2(), scomplex::imag, and scomplex::real.

222 {
223  scomplex x;
224  x.real = bl1_sm2();
225  x.imag = bl1_s0();
226  return x;
227 }
float real
Definition: blis_type_defs.h:134
float bl1_s0(void)
Definition: bl1_constants.c:111
Definition: blis_type_defs.h:132
float imag
Definition: blis_type_defs.h:134
float bl1_sm2(void)
Definition: bl1_constants.c:207

◆ bl1_cmaxabsm()

void bl1_cmaxabsm ( int  m,
int  n,
scomplex a,
int  a_rs,
int  a_cs,
float *  maxabs 
)

References bl1_cmaxabsv(), bl1_is_row_storage(), bl1_s0(), and bl1_zero_dim2().

Referenced by FLA_Max_abs_value().

104 {
105  float zero = bl1_s0();
106  scomplex* a_begin;
107  float maxabs_cand;
108  float maxabs_temp;
109  int inca, lda;
110  int n_iter;
111  int n_elem;
112  int j;
113 
114  // Return early if possible.
115  if ( bl1_zero_dim2( m, n ) ) { *maxabs = zero; return; }
116 
117  // Initialize with optimal values for column-major storage.
118  inca = a_rs;
119  lda = a_cs;
120  n_iter = n;
121  n_elem = m;
122 
123  // An optimization: if A is row-major, then let's access the matrix by
124  // rows instead of by columns for increased spatial locality.
125  if ( bl1_is_row_storage( a_rs, a_cs ) )
126  {
127  bl1_swap_ints( n_iter, n_elem );
128  bl1_swap_ints( lda, inca );
129  }
130 
131  // Initialize the maximum absolute value candidate to the first element.
132  bl1_csabsval2( a, &maxabs_cand );
133 
134  for ( j = 0; j < n_iter; j++ )
135  {
136  a_begin = a + j*lda;
137 
138  bl1_cmaxabsv( n_elem,
139  a_begin, inca,
140  &maxabs_temp );
141 
142  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
143  }
144 
145  *maxabs = maxabs_cand;
146 }
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
void bl1_cmaxabsv(int n, scomplex *x, int incx, float *maxabs)
Definition: bl1_maxabsv.c:55
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
Definition: blis_type_defs.h:132
float bl1_s0(void)
Definition: bl1_constants.c:111

◆ bl1_cmaxabsmr()

void bl1_cmaxabsmr ( uplo1_t  uplo,
int  m,
int  n,
scomplex a,
int  a_rs,
int  a_cs,
float *  maxabs 
)

References bl1_cmaxabsv(), bl1_d0(), bl1_is_row_storage(), bl1_is_upper(), and bl1_zero_dim2().

Referenced by FLA_Max_abs_value_herm().

144 {
145  float zero = bl1_d0();
146  scomplex* a_begin;
147  float maxabs_cand;
148  float maxabs_temp;
149  int inca, lda;
150  int n_iter;
151  int n_elem_max;
152  int n_elem;
153  int j;
154 
155  // Return early if possible.
156  if ( bl1_zero_dim2( m, n ) ) { *maxabs = zero; return; }
157 
158  // Initialize with optimal values for column-major storage.
159  n_iter = n;
160  n_elem_max = m;
161  lda = a_cs;
162  inca = a_rs;
163 
164  // An optimization: if A is row-major, then let's access the matrix by
165  // rows instead of by columns for increased spatial locality.
166  if ( bl1_is_row_storage( a_rs, a_cs ) )
167  {
168  bl1_swap_ints( n_iter, n_elem_max );
169  bl1_swap_ints( lda, inca );
170  bl1_toggle_uplo( uplo );
171  }
172 
173  // Initialize the maximum absolute value candidate to the first element.
174  bl1_csabsval2( a, &maxabs_cand );
175 
176  if ( bl1_is_upper( uplo ) )
177  {
178  for ( j = 0; j < n_iter; j++ )
179  {
180  n_elem = bl1_min( j + 1, n_elem_max );
181  a_begin = a + j*lda;
182 
183  bl1_cmaxabsv( n_elem,
184  a_begin, inca,
185  &maxabs_temp );
186 
187  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
188  }
189  }
190  else // if ( bl1_is_lower( uplo ) )
191  {
192  for ( j = 0; j < n_iter; j++ )
193  {
194  n_elem = bl1_max( 0, n_elem_max - j );
195  a_begin = a + j*lda + j*inca;
196 
197  bl1_cmaxabsv( n_elem,
198  a_begin, inca,
199  &maxabs_temp );
200 
201  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
202  }
203  }
204 
205  *maxabs = maxabs_cand;
206 }
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
double bl1_d0(void)
Definition: bl1_constants.c:118
void bl1_cmaxabsv(int n, scomplex *x, int incx, float *maxabs)
Definition: bl1_maxabsv.c:55
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
Definition: blis_type_defs.h:132

◆ bl1_cmaxabsv()

void bl1_cmaxabsv ( int  n,
scomplex x,
int  incx,
float *  maxabs 
)

References i.

Referenced by bl1_cmaxabsm(), and bl1_cmaxabsmr().

56 {
57  scomplex* chi;
58  float maxabs_cand;
59  float maxabs_temp;
60  int i;
61 
62  bl1_csabsval2( x, &maxabs_cand );
63 
64  for ( i = 0; i < n; ++i )
65  {
66  chi = x + i*incx;
67 
68  bl1_csabsval2( chi, &maxabs_temp );
69 
70  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
71  }
72 
73  *maxabs = maxabs_cand;
74 }
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145

◆ bl1_crandm()

void bl1_crandm ( int  m,
int  n,
scomplex a,
int  a_rs,
int  a_cs 
)

References bl1_crandv(), bl1_is_row_storage(), and bl1_zero_dim2().

Referenced by FLA_Random_matrix().

82 {
83  scomplex* a_begin;
84  int inca, lda;
85  int n_iter;
86  int n_elem;
87  int j;
88 
89  // Return early if possible.
90  if ( bl1_zero_dim2( m, n ) ) return;
91 
92  // Initialize with optimal values for column-major storage.
93  inca = a_rs;
94  lda = a_cs;
95  n_iter = n;
96  n_elem = m;
97 
98  // An optimization: if A is row-major, then let's access the matrix by
99  // rows instead of by columns for increased spatial locality.
100  if ( bl1_is_row_storage( a_rs, a_cs ) )
101  {
102  bl1_swap_ints( n_iter, n_elem );
103  bl1_swap_ints( lda, inca );
104  }
105 
106  for ( j = 0; j < n_iter; j++ )
107  {
108  a_begin = a + j*lda;
109 
110  bl1_crandv( n_elem,
111  a_begin, inca );
112  }
113 }
void bl1_crandv(int n, scomplex *x, int incx)
Definition: bl1_randv.c:39
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
Definition: blis_type_defs.h:132

◆ bl1_crandmr()

void bl1_crandmr ( uplo1_t  uplo,
diag1_t  diag,
int  m,
int  n,
scomplex a,
int  a_rs,
int  a_cs 
)

References bl1_c0(), bl1_c1(), bl1_cinvscalv(), bl1_crands(), bl1_crandv(), bl1_csetv(), bl1_is_nonunit_diag(), bl1_is_row_storage(), bl1_is_unit_diag(), bl1_is_upper(), bl1_is_zero_diag(), bl1_zero_dim2(), BLIS1_NO_CONJUGATE, and scomplex::real.

Referenced by FLA_Random_tri_matrix().

256 {
257  scomplex* a_begin;
258  scomplex* ajj;
259  scomplex one;
260  scomplex zero;
261  scomplex ord;
262  int lda, inca;
263  int n_iter;
264  int n_elem_max;
265  int n_elem;
266  int j;
267 
268  // Return early if possible.
269  if ( bl1_zero_dim2( m, n ) ) return;
270 
271  // Initialize with optimal values for column-major storage.
272  n_iter = n;
273  n_elem_max = m;
274  lda = a_cs;
275  inca = a_rs;
276 
277  // An optimization: if A is row-major, then let's access the matrix by
278  // rows instead of by columns to increase spatial locality.
279  if ( bl1_is_row_storage( a_rs, a_cs ) )
280  {
281  bl1_swap_ints( n_iter, n_elem_max );
282  bl1_swap_ints( lda, inca );
283  bl1_toggle_uplo( uplo );
284  }
285 
286  // Initialize some scalars.
287  one = bl1_c1();
288  zero = bl1_c0();
289  ord = bl1_c0();
290  ord.real = ( float ) bl1_max( m, n );
291 
292  if ( bl1_is_upper( uplo ) )
293  {
294  for ( j = 0; j < n_iter; j++ )
295  {
296  n_elem = bl1_min( j, n_elem_max );
297  a_begin = a + j*lda;
298 
299  // Randomize super-diagonal elements.
300  bl1_crandv( n_elem,
301  a_begin, inca );
302 
303  // Normalize super-diagonal elements by order of the matrix.
305  n_elem,
306  &ord,
307  a_begin, inca );
308 
309  // Initialize diagonal and sub-diagonal elements only if there are
310  // elements left in the column (ie: j < n_elem_max).
311  if ( j < n_elem_max )
312  {
313  ajj = a_begin + j*inca;
314 
315  // Initialize diagonal element.
316  if ( bl1_is_unit_diag( diag ) ) *ajj = one;
317  else if ( bl1_is_zero_diag( diag ) ) *ajj = zero;
318  else if ( bl1_is_nonunit_diag( diag ) )
319  {
320  // We want positive diagonal elements between 1 and 2.
321  bl1_crands( ajj );
322  bl1_cabsval2( ajj, ajj );
323  bl1_cadd3( ajj, &one, ajj );
324  }
325 
326  // Initialize sub-diagonal elements to zero.
327  bl1_csetv( n_elem_max - j - 1,
328  &zero,
329  ajj + inca, inca );
330  }
331  }
332  }
333  else // if ( bl1_is_lower( uplo ) )
334  {
335  for ( j = 0; j < n_iter; j++ )
336  {
337  n_elem = bl1_min( j, n_elem_max );
338  a_begin = a + j*lda;
339 
340  // Initialize super-diagonal to zero.
341  bl1_csetv( n_elem,
342  &zero,
343  a_begin, inca );
344 
345  // Initialize diagonal and sub-diagonal elements only if there are
346  // elements left in the column (ie: j < n_elem_max).
347  if ( j < n_elem_max )
348  {
349  ajj = a_begin + j*inca;
350 
351  // Initialize diagonal element.
352  if ( bl1_is_unit_diag( diag ) ) *ajj = one;
353  else if ( bl1_is_zero_diag( diag ) ) *ajj = zero;
354  else if ( bl1_is_nonunit_diag( diag ) )
355  {
356  // We want positive diagonal elements between 1 and 2.
357  bl1_crands( ajj );
358  bl1_cabsval2( ajj, ajj );
359  bl1_cadd3( ajj, &one, ajj );
360  }
361 
362  // Randomize sub-diagonal elements.
363  bl1_crandv( n_elem_max - j - 1,
364  ajj + inca, inca );
365 
366  // Normalize sub-diagonal elements by order of the matrix.
368  n_elem_max - j - 1,
369  &ord,
370  ajj + inca, inca );
371 
372  }
373  }
374  }
375 }
void bl1_crandv(int n, scomplex *x, int incx)
Definition: bl1_randv.c:39
float real
Definition: blis_type_defs.h:134
void bl1_csetv(int m, scomplex *sigma, scomplex *x, int incx)
Definition: bl1_setv.c:52
Definition: blis_type_defs.h:81
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
scomplex bl1_c1(void)
Definition: bl1_constants.c:61
scomplex bl1_c0(void)
Definition: bl1_constants.c:125
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_nonunit_diag(diag1_t diag)
Definition: bl1_is.c:73
int bl1_is_unit_diag(diag1_t diag)
Definition: bl1_is.c:78
void bl1_crands(scomplex *alpha)
Definition: bl1_rands.c:23
Definition: blis_type_defs.h:132
int bl1_is_zero_diag(diag1_t diag)
Definition: bl1_is.c:83
void bl1_cinvscalv(conj1_t conj, int n, scomplex *alpha, scomplex *x, int incx)
Definition: bl1_invscalv.c:52

◆ bl1_crands()

void bl1_crands ( scomplex alpha)

References bl1_srands(), scomplex::imag, and scomplex::real.

Referenced by bl1_crandmr(), and bl1_crandv().

24 {
25  bl1_srands( &(alpha->real) );
26  bl1_srands( &(alpha->imag) );
27 }
float real
Definition: blis_type_defs.h:134
void bl1_srands(float *alpha)
Definition: bl1_rands.c:13
float imag
Definition: blis_type_defs.h:134

◆ bl1_crandv()

void bl1_crandv ( int  n,
scomplex x,
int  incx 
)

References bl1_crands(), and i.

Referenced by bl1_crandm(), and bl1_crandmr().

40 {
41  scomplex* chi;
42  int i;
43 
44  for ( i = 0; i < n; ++i )
45  {
46  chi = x + i*incx;
47 
48  bl1_crands( chi );
49  }
50 }
void bl1_crands(scomplex *alpha)
Definition: bl1_rands.c:23
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145

◆ bl1_csapdiagmv()

void bl1_csapdiagmv ( side1_t  side,
conj1_t  conj,
int  m,
int  n,
float *  x,
int  incx,
scomplex a,
int  a_rs,
int  a_cs 
)

References bl1_csewscalv(), bl1_csscalv(), bl1_is_left(), bl1_is_row_storage(), and bl1_zero_dim2().

Referenced by FLA_Apply_diag_matrix().

124 {
125  float* chi;
126  scomplex* a_begin;
127  int inca, lda;
128  int n_iter;
129  int n_elem;
130  int j;
131 
132  // Return early if possible.
133  if ( bl1_zero_dim2( m, n ) ) return;
134 
135  // Initialize with optimal values for column-major storage.
136  inca = a_rs;
137  lda = a_cs;
138  n_iter = n;
139  n_elem = m;
140 
141  // An optimization: if A is row-major, then we can proceed as if the
142  // operation were transposed (applying the diagonal values in x from the
143  // opposite side) for increased spatial locality.
144  if ( bl1_is_row_storage( a_rs, a_cs ) )
145  {
146  bl1_swap_ints( n_iter, n_elem );
147  bl1_swap_ints( lda, inca );
148  bl1_toggle_side( side );
149  }
150 
151  if ( bl1_is_left( side ) )
152  {
153  for ( j = 0; j < n_iter; j++ )
154  {
155  a_begin = a + j*lda;
156 
157  bl1_csewscalv( conj,
158  n_elem,
159  x, incx,
160  a_begin, inca );
161  }
162  }
163  else
164  {
165  for ( j = 0; j < n_iter; j++ )
166  {
167  a_begin = a + j*lda;
168  chi = x + j*incx;
169 
170  bl1_csscalv( conj,
171  n_elem,
172  chi,
173  a_begin, inca );
174  }
175  }
176 }
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_csscalv(conj1_t conj, int n, float *alpha, scomplex *x, int incx)
Definition: bl1_scalv.c:35
Definition: blis_type_defs.h:132
void bl1_csewscalv(conj1_t conj, int n, float *x, int incx, scomplex *y, int incy)
Definition: bl1_ewscalv.c:43

◆ bl1_cscalediag()

void bl1_cscalediag ( conj1_t  conj,
int  offset,
int  m,
int  n,
scomplex sigma,
scomplex a,
int  a_rs,
int  a_cs 
)

References i.

Referenced by FLA_Scale_diag(), and FLA_UDdate_UT_opc_var1().

100 {
101  scomplex* alpha;
102  scomplex sigma_conj;
103  int i, j;
104 
105  bl1_ccopys( conj, sigma, &sigma_conj );
106 
107  i = j = 0;
108 
109  if ( offset < 0 ) i = -offset;
110  else if ( offset > 0 ) j = offset;
111 
112  while ( i < m && j < n )
113  {
114  alpha = a + i*a_rs + j*a_cs;
115 
116  bl1_cscals( &sigma_conj, alpha );
117 
118  ++i;
119  ++j;
120  }
121 }
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145

◆ bl1_csetdiag()

void bl1_csetdiag ( int  offset,
int  m,
int  n,
scomplex sigma,
scomplex a,
int  a_rs,
int  a_cs 
)

References i, scomplex::imag, and scomplex::real.

Referenced by FLA_Set_diag(), FLA_Set_offdiag(), and FLA_Triangularize().

77 {
78  scomplex* alpha;
79  int i, j;
80 
81  i = j = 0;
82 
83  if ( offset < 0 ) i = -offset;
84  else if ( offset > 0 ) j = offset;
85 
86  while ( i < m && j < n )
87  {
88  alpha = a + i*a_rs + j*a_cs;
89 
90  alpha->real = sigma->real;
91  alpha->imag = sigma->imag;
92 
93  ++i;
94  ++j;
95  }
96 }
float real
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145
float imag
Definition: blis_type_defs.h:134

◆ bl1_csetm()

void bl1_csetm ( int  m,
int  n,
scomplex sigma,
scomplex a,
int  a_rs,
int  a_cs 
)

References i, scomplex::imag, and scomplex::real.

Referenced by FLA_Bidiag_UT_u_step_ofc_var4(), FLA_Bidiag_UT_u_step_opc_var4(), FLA_Bidiag_UT_u_step_opc_var5(), FLA_Bsvd_ext_opc_var1(), FLA_Bsvd_ext_ops_var1(), FLA_Bsvd_v_opc_var1(), FLA_Bsvd_v_ops_var1(), FLA_Hess_UT_step_ofc_var4(), FLA_Hess_UT_step_opc_var4(), FLA_Hess_UT_step_opc_var5(), FLA_Set(), FLA_Tridiag_UT_l_step_ofc_var3(), and FLA_Tridiag_UT_l_step_opc_var3().

62 {
63  scomplex* alpha;
64  int i, j;
65 
66  for ( j = 0; j < n; ++j )
67  {
68  for ( i = 0; i < m; ++i )
69  {
70  alpha = a + i*a_rs + j*a_cs;
71 
72  alpha->real = sigma->real;
73  alpha->imag = sigma->imag;
74  }
75  }
76 }
float real
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145
float imag
Definition: blis_type_defs.h:134

◆ bl1_csetmr()

void bl1_csetmr ( uplo1_t  uplo,
int  m,
int  n,
scomplex sigma,
scomplex a,
int  a_rs,
int  a_cs 
)

References bl1_csetv(), bl1_is_row_storage(), bl1_is_upper(), and bl1_zero_dim2().

Referenced by FLA_Setr(), and FLA_Triangularize().

120 {
121  scomplex* a_begin;
122  int lda, inca;
123  int n_iter;
124  int n_elem_max;
125  int n_elem;
126  int j;
127 
128  // Return early if possible.
129  if ( bl1_zero_dim2( m, n ) ) return;
130 
131  // Initialize with optimal values for column-major storage.
132  n_iter = n;
133  n_elem_max = m;
134  lda = a_cs;
135  inca = a_rs;
136 
137  // An optimization: if A is row-major, then let's access the matrix by
138  // rows instead of by columns to increase spatial locality.
139  if ( bl1_is_row_storage( a_rs, a_cs ) )
140  {
141  bl1_swap_ints( n_iter, n_elem_max );
142  bl1_swap_ints( lda, inca );
143  bl1_toggle_uplo( uplo );
144  }
145 
146  if ( bl1_is_upper( uplo ) )
147  {
148  for ( j = 0; j < n_iter; j++ )
149  {
150  n_elem = bl1_min( j, n_elem_max );
151  a_begin = a + j*lda;
152 
153  bl1_csetv( n_elem,
154  sigma,
155  a_begin, inca );
156  }
157  }
158  else // if ( bl1_is_lower( uplo ) )
159  {
160  for ( j = 0; j < n_iter; j++ )
161  {
162  n_elem = bl1_max( 0, n_elem_max - j - 1 );
163  a_begin = a + j*lda + (j + 1)*inca;
164 
165  bl1_csetv( n_elem,
166  sigma,
167  a_begin, inca );
168  }
169  }
170 }
void bl1_csetv(int m, scomplex *sigma, scomplex *x, int incx)
Definition: bl1_setv.c:52
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
Definition: blis_type_defs.h:132

◆ bl1_csetv()

void bl1_csetv ( int  m,
scomplex sigma,
scomplex x,
int  incx 
)

References i, scomplex::imag, and scomplex::real.

Referenced by bl1_crandmr(), bl1_csetmr(), FLA_Bidiag_UT_u_step_ofc_var4(), FLA_Bidiag_UT_u_step_opc_var4(), FLA_Fused_Ahx_Ax_opc_var1(), FLA_Fused_Ahx_Axpy_Ax_opc_var1(), FLA_Fused_Gerc2_Ahx_Ax_opc_var1(), FLA_Fused_Gerc2_Ahx_Axpy_Ax_opc_var1(), FLA_Fused_Her2_Ax_l_opc_var1(), FLA_Tridiag_UT_l_realify_opt(), FLA_Tridiag_UT_realify_subdiagonal_opt(), FLA_Tridiag_UT_shift_U_l_opc(), and FLA_Tridiag_UT_u_realify_opt().

53 {
54  scomplex* chi;
55  int i;
56 
57  for ( i = 0; i < n; ++i )
58  {
59  chi = x + i*incx;
60 
61  chi->real = sigma->real;
62  chi->imag = sigma->imag;
63  }
64 }
float real
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145
float imag
Definition: blis_type_defs.h:134

◆ bl1_csewinvscalmt()

void bl1_csewinvscalmt ( trans1_t  trans,
int  m,
int  n,
float *  a,
int  a_rs,
int  a_cs,
scomplex b,
int  b_rs,
int  b_cs 
)

References bl1_csewinvscalv(), bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

158 {
159  float* a_begin;
160  scomplex* b_begin;
161  int lda, inca;
162  int ldb, incb;
163  int n_iter;
164  int n_elem;
165  int j;
166  conj1_t conj;
167 
168  // Return early if possible.
169  if ( bl1_zero_dim2( m, n ) ) return;
170 
171  // Handle cases where A and B are vectors to ensure that the underlying ewinvscal
172  // gets invoked only once.
173  if ( bl1_is_vector( m, n ) )
174  {
175  // Initialize with values appropriate for vectors.
176  n_iter = 1;
177  n_elem = bl1_vector_dim( m, n );
178  lda = 1; // multiplied by zero when n_iter == 1; not needed.
179  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
180  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
181  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
182  }
183  else // matrix case
184  {
185  // Initialize with optimal values for column-major storage.
186  n_iter = n;
187  n_elem = m;
188  lda = a_cs;
189  inca = a_rs;
190  ldb = b_cs;
191  incb = b_rs;
192 
193  // Handle the transposition of A.
194  if ( bl1_does_trans( trans ) )
195  {
196  bl1_swap_ints( lda, inca );
197  }
198 
199  // An optimization: if B is row-major and if A is effectively row-major
200  // after a possible transposition, then let's access the matrices by rows
201  // instead of by columns for increased spatial locality.
202  if ( bl1_is_row_storage( b_rs, b_cs ) )
203  {
204  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
205  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
206  {
207  bl1_swap_ints( n_iter, n_elem );
208  bl1_swap_ints( lda, inca );
209  bl1_swap_ints( ldb, incb );
210  }
211  }
212  }
213 
214  // Extract conj component from trans parameter.
215  conj = bl1_proj_trans1_to_conj( trans );
216 
217  for ( j = 0; j < n_iter; j++ )
218  {
219  a_begin = a + j*lda;
220  b_begin = b + j*ldb;
221 
222  bl1_csewinvscalv( conj,
223  n_elem,
224  a_begin, inca,
225  b_begin, incb );
226  }
227 }
int bl1_vector_dim(int m, int n)
Definition: bl1_vector.c:13
conj1_t
Definition: blis_type_defs.h:79
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_does_notrans(trans1_t trans)
Definition: bl1_does.c:19
int bl1_vector_inc(trans1_t trans, int m, int n, int rs, int cs)
Definition: bl1_vector.c:19
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
Definition: blis_type_defs.h:54
Definition: blis_type_defs.h:132
void bl1_csewinvscalv(conj1_t conj, int n, float *x, int incx, scomplex *y, int incy)
Definition: bl1_ewinvscalv.c:43
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition: bl1_proj.c:13
int bl1_is_vector(int m, int n)
Definition: bl1_is.c:106
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13

◆ bl1_csewinvscalv()

void bl1_csewinvscalv ( conj1_t  conj,
int  n,
float *  x,
int  incx,
scomplex y,
int  incy 
)

References i.

Referenced by bl1_csewinvscalmt().

44 {
45  float* chi;
46  scomplex* psi;
47  int i;
48 
49  for ( i = 0; i < n; ++i )
50  {
51  chi = x + i*incx;
52  psi = y + i*incy;
53 
54  bl1_csinvscals( chi, psi );
55  }
56 }
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145

◆ bl1_csewscalmt()

void bl1_csewscalmt ( trans1_t  trans,
int  m,
int  n,
float *  a,
int  a_rs,
int  a_cs,
scomplex b,
int  b_rs,
int  b_cs 
)

References bl1_csewscalv(), bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

158 {
159  float* a_begin;
160  scomplex* b_begin;
161  int lda, inca;
162  int ldb, incb;
163  int n_iter;
164  int n_elem;
165  int j;
166  conj1_t conj;
167 
168  // Return early if possible.
169  if ( bl1_zero_dim2( m, n ) ) return;
170 
171  // Handle cases where A and B are vectors to ensure that the underlying ewscal
172  // gets invoked only once.
173  if ( bl1_is_vector( m, n ) )
174  {
175  // Initialize with values appropriate for vectors.
176  n_iter = 1;
177  n_elem = bl1_vector_dim( m, n );
178  lda = 1; // multiplied by zero when n_iter == 1; not needed.
179  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
180  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
181  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
182  }
183  else // matrix case
184  {
185  // Initialize with optimal values for column-major storage.
186  n_iter = n;
187  n_elem = m;
188  lda = a_cs;
189  inca = a_rs;
190  ldb = b_cs;
191  incb = b_rs;
192 
193  // Handle the transposition of A.
194  if ( bl1_does_trans( trans ) )
195  {
196  bl1_swap_ints( lda, inca );
197  }
198 
199  // An optimization: if B is row-major and if A is effectively row-major
200  // after a possible transposition, then let's access the matrices by rows
201  // instead of by columns for increased spatial locality.
202  if ( bl1_is_row_storage( b_rs, b_cs ) )
203  {
204  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
205  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
206  {
207  bl1_swap_ints( n_iter, n_elem );
208  bl1_swap_ints( lda, inca );
209  bl1_swap_ints( ldb, incb );
210  }
211  }
212  }
213 
214  // Extract conj component from trans parameter.
215  conj = bl1_proj_trans1_to_conj( trans );
216 
217  for ( j = 0; j < n_iter; j++ )
218  {
219  a_begin = a + j*lda;
220  b_begin = b + j*ldb;
221 
222  bl1_csewscalv( conj,
223  n_elem,
224  a_begin, inca,
225  b_begin, incb );
226  }
227 }
int bl1_vector_dim(int m, int n)
Definition: bl1_vector.c:13
conj1_t
Definition: blis_type_defs.h:79
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_does_notrans(trans1_t trans)
Definition: bl1_does.c:19
int bl1_vector_inc(trans1_t trans, int m, int n, int rs, int cs)
Definition: bl1_vector.c:19
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
Definition: blis_type_defs.h:54
Definition: blis_type_defs.h:132
void bl1_csewscalv(conj1_t conj, int n, float *x, int incx, scomplex *y, int incy)
Definition: bl1_ewscalv.c:43
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition: bl1_proj.c:13
int bl1_is_vector(int m, int n)
Definition: bl1_is.c:106
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13

◆ bl1_csewscalv()

void bl1_csewscalv ( conj1_t  conj,
int  n,
float *  x,
int  incx,
scomplex y,
int  incy 
)

References i.

Referenced by bl1_csapdiagmv(), and bl1_csewscalmt().

44 {
45  float* chi;
46  scomplex* psi;
47  int i;
48 
49  for ( i = 0; i < n; ++i )
50  {
51  chi = x + i*incx;
52  psi = y + i*incy;
53 
54  bl1_csscals( chi, psi );
55  }
56 }
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145

◆ bl1_cshiftdiag()

void bl1_cshiftdiag ( conj1_t  conj,
int  offset,
int  m,
int  n,
scomplex sigma,
scomplex a,
int  a_rs,
int  a_cs 
)

References i, scomplex::imag, and scomplex::real.

Referenced by FLA_Lyap_h_opc_var1(), FLA_Lyap_h_opc_var2(), FLA_Lyap_h_opc_var3(), FLA_Lyap_h_opc_var4(), FLA_Lyap_n_opc_var1(), FLA_Lyap_n_opc_var2(), FLA_Lyap_n_opc_var3(), FLA_Lyap_n_opc_var4(), and FLA_Shift_diag().

98 {
99  scomplex* alpha;
100  scomplex sigma_conj;
101  int i, j;
102 
103  bl1_ccopys( conj, sigma, &sigma_conj );
104 
105  i = j = 0;
106 
107  if ( offset < 0 ) i = -offset;
108  else if ( offset > 0 ) j = offset;
109 
110  while ( i < m && j < n )
111  {
112  alpha = a + i*a_rs + j*a_cs;
113 
114  alpha->real += sigma_conj.real;
115  alpha->imag += sigma_conj.imag;
116 
117  ++i;
118  ++j;
119  }
120 }
float real
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145
float imag
Definition: blis_type_defs.h:134

◆ bl1_csscalediag()

void bl1_csscalediag ( conj1_t  conj,
int  offset,
int  m,
int  n,
float *  sigma,
scomplex a,
int  a_rs,
int  a_cs 
)

References i, scomplex::imag, and scomplex::real.

Referenced by FLA_Scale_diag().

56 {
57  scomplex* alpha;
58  int i, j;
59 
60  i = j = 0;
61 
62  if ( offset < 0 ) i = -offset;
63  else if ( offset > 0 ) j = offset;
64 
65  while ( i < m && j < n )
66  {
67  alpha = a + i*a_rs + j*a_cs;
68 
69  alpha->real *= *sigma;
70  alpha->imag *= *sigma;
71 
72  ++i;
73  ++j;
74  }
75 }
float real
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145
float imag
Definition: blis_type_defs.h:134

◆ bl1_csshiftdiag()

void bl1_csshiftdiag ( conj1_t  conj,
int  offset,
int  m,
int  n,
float *  sigma,
scomplex a,
int  a_rs,
int  a_cs 
)

References i, and scomplex::real.

Referenced by FLA_Shift_diag().

56 {
57  scomplex* alpha;
58  int i, j;
59 
60  i = j = 0;
61 
62  if ( offset < 0 ) i = -offset;
63  else if ( offset > 0 ) j = offset;
64 
65  while ( i < m && j < n )
66  {
67  alpha = a + i*a_rs + j*a_cs;
68 
69  alpha->real += *sigma;
70 
71  ++i;
72  ++j;
73  }
74 }
float real
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:132
int i
Definition: bl1_axmyv2.c:145

◆ bl1_csymmize()

void bl1_csymmize ( conj1_t  conj,
uplo1_t  uplo,
int  m,
scomplex a,
int  a_rs,
int  a_cs 
)

References bl1_ccopyv(), bl1_is_col_storage(), bl1_is_conj(), bl1_is_gen_storage(), bl1_is_lower(), bl1_is_row_storage(), bl1_is_upper(), bl1_s0(), bl1_zero_dim1(), and scomplex::imag.

Referenced by FLA_Hermitianize(), and FLA_Symmetrize().

236 {
237  scomplex* a_src;
238  scomplex* a_dst;
239  scomplex* a_jj;
240  int rs_src, cs_src, inc_src;
241  int rs_dst, cs_dst, inc_dst;
242  int n_iter;
243  int j;
244 
245  // Return early if possible.
246  if ( bl1_zero_dim1( m ) ) return;
247 
248  // Assume A is square.
249  n_iter = m;
250 
251  // Initialize with appropriate values based on storage.
252  if ( bl1_is_col_storage( a_rs, a_cs ) && bl1_is_lower( uplo ) )
253  {
254  cs_src = 1;
255  rs_src = 0;
256  inc_src = a_cs;
257  cs_dst = a_cs;
258  rs_dst = 0;
259  inc_dst = 1;
260  }
261  else if ( bl1_is_col_storage( a_rs, a_cs ) && bl1_is_upper( uplo ) )
262  {
263  cs_src = a_cs;
264  rs_src = 0;
265  inc_src = 1;
266  cs_dst = 1;
267  rs_dst = 0;
268  inc_dst = a_cs;
269  }
270  else if ( bl1_is_row_storage( a_rs, a_cs ) && bl1_is_lower( uplo ) )
271  {
272  cs_src = 0;
273  rs_src = a_rs;
274  inc_src = 1;
275  cs_dst = 0;
276  rs_dst = 1;
277  inc_dst = a_rs;
278  }
279  else if ( bl1_is_row_storage( a_rs, a_cs ) && bl1_is_upper( uplo ) )
280  {
281  cs_src = 0;
282  rs_src = 1;
283  inc_src = a_rs;
284  cs_dst = 0;
285  rs_dst = a_rs;
286  inc_dst = 1;
287  }
288  else if ( bl1_is_gen_storage( a_rs, a_cs ) && bl1_is_lower( uplo ) )
289  {
290  // General stride with column-major tilt looks similar to column-major.
291  // General stride with row-major tilt looks similar to row-major.
292  if ( a_rs < a_cs )
293  {
294  cs_src = 1 * a_rs;
295  rs_src = 0;
296  inc_src = a_cs;
297  cs_dst = a_cs;
298  rs_dst = 0;
299  inc_dst = 1 * a_rs;
300  }
301  else // if ( a_rs > a_cs )
302  {
303  cs_src = 0;
304  rs_src = a_rs;
305  inc_src = 1 * a_cs;
306  cs_dst = 0;
307  rs_dst = 1 * a_cs;
308  inc_dst = a_rs;
309  }
310  }
311  else // if ( bl1_is_gen_storage( a_rs, a_cs ) && bl1_is_upper( uplo ) )
312  {
313  // General stride with column-major tilt looks similar to column-major.
314  // General stride with row-major tilt looks similar to row-major.
315  if ( a_rs < a_cs )
316  {
317  cs_src = a_cs;
318  rs_src = 0;
319  inc_src = 1 * a_rs;
320  cs_dst = 1 * a_rs;
321  rs_dst = 0;
322  inc_dst = a_cs;
323  }
324  else // if ( a_rs > a_cs )
325  {
326  cs_src = 0;
327  rs_src = 1 * a_cs;
328  inc_src = a_rs;
329  cs_dst = 0;
330  rs_dst = a_rs;
331  inc_dst = 1 * a_cs;
332  }
333  }
334 
335  for ( j = 0; j < n_iter; j++ )
336  {
337  a_src = a + j*cs_src + j*rs_src;
338  a_dst = a + j*cs_dst + j*rs_dst;
339 
340  bl1_ccopyv( conj,
341  j,
342  a_src, inc_src,
343  a_dst, inc_dst );
344 
345  if ( bl1_is_conj( conj ) )
346  {
347  a_jj = a + j*a_rs + j*a_cs;
348  a_jj->imag = bl1_s0();
349  }
350  }
351 }
int bl1_is_conj(conj1_t conj)
Definition: bl1_is.c:42
int bl1_is_lower(uplo1_t uplo)
Definition: bl1_is.c:49
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
int bl1_zero_dim1(int m)
Definition: bl1_is.c:113
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
Definition: blis_type_defs.h:132
void bl1_ccopyv(conj1_t conj, int m, scomplex *x, int incx, scomplex *y, int incy)
Definition: bl1_copyv.c:49
float bl1_s0(void)
Definition: bl1_constants.c:111
float imag
Definition: blis_type_defs.h:134

◆ bl1_d0()

double bl1_d0 ( void  )

Referenced by bl1_cmaxabsmr(), bl1_dgemm(), bl1_dmaxabsm(), bl1_dmaxabsmr(), bl1_drandmr(), bl1_dsymm(), bl1_z0(), bl1_z1(), bl1_z1h(), bl1_z2(), bl1_zher2k(), bl1_zherk(), bl1_zm1(), bl1_zm1h(), bl1_zm2(), bl1_zmaxabsm(), bl1_zmaxabsmr(), bl1_zsymmize(), FLA_Apply_G_rf_asd_var1(), FLA_Apply_G_rf_asd_var2(), FLA_Apply_G_rf_asd_var3(), FLA_Apply_G_rf_asd_var3b(), FLA_Apply_G_rf_asd_var6(), FLA_Apply_G_rf_asd_var6b(), FLA_Apply_G_rf_asd_var9(), FLA_Apply_G_rf_asd_var9b(), FLA_Apply_G_rf_asz_var1(), FLA_Apply_G_rf_asz_var2(), FLA_Apply_G_rf_asz_var3(), FLA_Apply_G_rf_asz_var6(), FLA_Apply_G_rf_asz_var9(), FLA_Apply_G_rf_opd_var1(), FLA_Apply_G_rf_opd_var2(), FLA_Apply_G_rf_opd_var3(), FLA_Apply_G_rf_opd_var6(), FLA_Apply_G_rf_opd_var9(), FLA_Apply_G_rf_opz_var1(), FLA_Apply_G_rf_opz_var2(), FLA_Apply_G_rf_opz_var3(), FLA_Apply_G_rf_opz_var6(), FLA_Apply_G_rf_opz_var9(), FLA_Bsvd_compute_tol_thresh_opd(), FLA_Bsvd_ext_opd_var1(), FLA_Bsvd_ext_opz_var1(), FLA_Bsvd_find_submatrix_opd(), FLA_Bsvd_v_opd_var1(), FLA_Bsvd_v_opd_var2(), FLA_Bsvd_v_opz_var1(), FLA_Bsvd_v_opz_var2(), FLA_Fused_Ahx_Ax_opd_var1(), FLA_Fused_Ahx_Axpy_Ax_opd_var1(), FLA_Fused_Gerc2_Ahx_Ax_opd_var1(), FLA_Fused_Gerc2_Ahx_Axpy_Ax_opd_var1(), FLA_Fused_Uhu_Yhu_Zhu_opd_var1(), FLA_Fused_UYx_ZVx_opd_var1(), FLA_Fused_UZhu_ZUhu_opd_var1(), FLA_Pythag2_opd(), FLA_Pythag3_opd(), FLA_Tevd_find_submatrix_opd(), FLA_Tevd_v_opd_var2(), FLA_Tevd_v_opz_var2(), and FLA_Tridiag_UT_shift_U_l_opd().

119 {
120  double x;
121  x = 0.0;
122  return x;
123 }

◆ bl1_d1()

double bl1_d1 ( void  )

◆ bl1_d1h()

double bl1_d1h ( void  )

Referenced by bl1_z1h().

87 {
88  double x;
89  x = 0.5;
90  return x;
91 }

◆ bl1_d2()

double bl1_d2 ( void  )

Referenced by bl1_z2().

23 {
24  double x;
25  x = 2.0;
26  return x;
27 }

◆ bl1_dallocm()

double* bl1_dallocm ( unsigned int  m,
unsigned int  n 
)

Referenced by bl1_dcreate_contigm(), bl1_dcreate_contigmr(), bl1_dcreate_contigmt(), bl1_dgemm(), bl1_dsymm(), bl1_dsyr2k(), bl1_dtrmmsx(), and bl1_dtrsmsx().

36 {
37  return ( double* ) BLIS1_MALLOC( m * n * sizeof( double ) );
38 }

◆ bl1_dallocv()

double* bl1_dallocv ( unsigned int  n_elem)

Referenced by bl1_dtrmvsx(), and bl1_dtrsvsx().

36 {
37  return ( double* ) BLIS1_MALLOC( n_elem * sizeof( double ) );
38 }

◆ bl1_dapdiagmv()

void bl1_dapdiagmv ( side1_t  side,
conj1_t  conj,
int  m,
int  n,
double *  x,
int  incx,
double *  a,
int  a_rs,
int  a_cs 
)

References bl1_dewscalv(), bl1_dscalv(), bl1_is_left(), bl1_is_row_storage(), and bl1_zero_dim2().

Referenced by FLA_Apply_diag_matrix().

69 {
70  double* chi;
71  double* a_begin;
72  int inca, lda;
73  int n_iter;
74  int n_elem;
75  int j;
76 
77  // Return early if possible.
78  if ( bl1_zero_dim2( m, n ) ) return;
79 
80  // Initialize with optimal values for column-major storage.
81  inca = a_rs;
82  lda = a_cs;
83  n_iter = n;
84  n_elem = m;
85 
86  // An optimization: if A is row-major, then we can proceed as if the
87  // operation were transposed (applying the diagonal values in x from the
88  // opposite side) for increased spatial locality.
89  if ( bl1_is_row_storage( a_rs, a_cs ) )
90  {
91  bl1_swap_ints( n_iter, n_elem );
92  bl1_swap_ints( lda, inca );
93  bl1_toggle_side( side );
94  }
95 
96  if ( bl1_is_left( side ) )
97  {
98  for ( j = 0; j < n_iter; j++ )
99  {
100  a_begin = a + j*lda;
101 
102  bl1_dewscalv( conj,
103  n_elem,
104  x, incx,
105  a_begin, inca );
106  }
107  }
108  else
109  {
110  for ( j = 0; j < n_iter; j++ )
111  {
112  a_begin = a + j*lda;
113  chi = x + j*incx;
114 
115  bl1_dscalv( conj,
116  n_elem,
117  chi,
118  a_begin, inca );
119  }
120  }
121 }
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_dscalv(conj1_t conj, int n, double *alpha, double *x, int incx)
Definition: bl1_scalv.c:24
void bl1_dewscalv(conj1_t conj, int n, double *x, int incx, double *y, int incy)
Definition: bl1_ewscalv.c:28

◆ bl1_dcreate_contigm()

void bl1_dcreate_contigm ( int  m,
int  n,
double *  a_save,
int  a_rs_save,
int  a_cs_save,
double **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_dallocm(), bl1_dcopymt(), bl1_is_gen_storage(), bl1_set_contig_strides(), and BLIS1_NO_TRANSPOSE.

Referenced by bl1_dgemm(), bl1_dgemv(), bl1_dger(), bl1_dsymm(), bl1_dtrmm(), bl1_dtrmmsx(), bl1_dtrsm(), and bl1_dtrsmsx().

48 {
49  int m_contig, n_contig;
50 
51  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
52  {
53  // Initialize dimensions assuming no transposition needed during copy.
54  m_contig = m;
55  n_contig = n;
56 
57 /*
58  // Transpose the dimensions of the contiguous matrix, if requested.
59  if ( bl1_does_trans( trans_copy ) )
60  {
61  m_contig = n;
62  n_contig = m;
63  }
64 */
65 
66  // Allocate temporary contiguous storage for the matrix.
67  *a = bl1_dallocm( m_contig, n_contig );
68 
69  // Set the row and column strides for the temporary matrix.
70  bl1_set_contig_strides( m_contig, n_contig, a_rs, a_cs );
71 
72  // Initialize the contiguous matrix with the contents of the original.
74  m_contig,
75  n_contig,
76  a_save, a_rs_save, a_cs_save,
77  *a, *a_rs, *a_cs );
78  }
79 }
void bl1_dcopymt(trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:148
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
Definition: blis_type_defs.h:54
double * bl1_dallocm(unsigned int m, unsigned int n)
Definition: bl1_allocm.c:35
void bl1_set_contig_strides(int m, int n, int *rs, int *cs)
Definition: bl1_set_contig_strides.c:13

◆ bl1_dcreate_contigmr()

void bl1_dcreate_contigmr ( uplo1_t  uplo,
int  m,
int  n,
double *  a_save,
int  a_rs_save,
int  a_cs_save,
double **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_dallocm(), bl1_dcopymr(), bl1_is_gen_storage(), and bl1_set_contig_strides().

Referenced by bl1_dcreate_contigmsr(), bl1_dsymm(), bl1_dsymv(), bl1_dsyr(), bl1_dsyr2(), bl1_dsyr2k(), bl1_dsyrk(), bl1_dtrmm(), bl1_dtrmmsx(), bl1_dtrmv(), bl1_dtrmvsx(), bl1_dtrsm(), bl1_dtrsmsx(), bl1_dtrsv(), and bl1_dtrsvsx().

46 {
47  int m_contig, n_contig;
48 
49  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
50  {
51  // Initialize dimensions assuming no transposition needed during copy.
52  m_contig = m;
53  n_contig = n;
54 /*
55  // Transpose the dimensions of the contiguous matrix, if requested.
56  if ( bl1_does_trans( trans_copy ) )
57  {
58  m_contig = n;
59  n_contig = m;
60  }
61 */
62  // Allocate temporary contiguous storage for the matrix.
63  *a = bl1_dallocm( m_contig, n_contig );
64 
65  // Set the row and column strides for the temporary matrix.
66  bl1_set_contig_strides( m_contig, n_contig, a_rs, a_cs );
67 
68  // Initialize the contiguous matrix with the contents of the original.
69  bl1_dcopymr( uplo,
70  m_contig,
71  n_contig,
72  a_save, a_rs_save, a_cs_save,
73  *a, *a_rs, *a_cs );
74  }
75 }
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
void bl1_dcopymr(uplo1_t uplo, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:76
double * bl1_dallocm(unsigned int m, unsigned int n)
Definition: bl1_allocm.c:35
void bl1_set_contig_strides(int m, int n, int *rs, int *cs)
Definition: bl1_set_contig_strides.c:13

◆ bl1_dcreate_contigmsr()

void bl1_dcreate_contigmsr ( side1_t  side,
uplo1_t  uplo,
int  m,
int  n,
double *  a_save,
int  a_rs_save,
int  a_cs_save,
double **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_dcreate_contigmr(), and bl1_is_left().

30 {
31  int dim_a;
32 
33  // Choose the dimension of the matrix based on the side parameter.
34  if ( bl1_is_left( side ) ) dim_a = m;
35  else dim_a = n;
36 
37  // Call the simple version with chosen dimensions.
39  dim_a,
40  dim_a,
41  a_save, a_rs_save, a_cs_save,
42  a, a_rs, a_cs );
43 }
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61
void bl1_dcreate_contigmr(uplo1_t uplo, int m, int n, double *a_save, int a_rs_save, int a_cs_save, double **a, int *a_rs, int *a_cs)
Definition: bl1_create_contigmr.c:45

◆ bl1_dcreate_contigmt()

void bl1_dcreate_contigmt ( trans1_t  trans_dims,
int  m,
int  n,
double *  a_save,
int  a_rs_save,
int  a_cs_save,
double **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_dallocm(), bl1_dcopymt(), bl1_does_trans(), bl1_is_gen_storage(), bl1_set_contig_strides(), and BLIS1_NO_TRANSPOSE.

Referenced by bl1_dgemm(), bl1_dsyr2k(), and bl1_dsyrk().

52 {
53  int m_contig, n_contig;
54 
55  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
56  {
57  // Transpose the dimensions if requested.
58  if ( bl1_does_trans( trans_dims ) )
59  bl1_swap_ints( m, n );
60 
61  // Initialize dimensions assuming no transposition needed during copy.
62  m_contig = m;
63  n_contig = n;
64 
65 /*
66  // Transpose the dimensions of the contiguous matrix, if requested.
67  if ( bl1_does_trans( trans_copy ) )
68  {
69  m_contig = n;
70  n_contig = m;
71  }
72 */
73 
74  // Allocate temporary contiguous storage for the matrix.
75  *a = bl1_dallocm( m_contig, n_contig );
76 
77  // Set the row and column strides for the temporary matrix.
78  bl1_set_contig_strides( m_contig, n_contig, a_rs, a_cs );
79 
80  // Initialize the contiguous matrix with the contents of the original.
82  m_contig,
83  n_contig,
84  a_save, a_rs_save, a_cs_save,
85  *a, *a_rs, *a_cs );
86  }
87 }
void bl1_dcopymt(trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:148
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
Definition: blis_type_defs.h:54
double * bl1_dallocm(unsigned int m, unsigned int n)
Definition: bl1_allocm.c:35
void bl1_set_contig_strides(int m, int n, int *rs, int *cs)
Definition: bl1_set_contig_strides.c:13
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13

◆ bl1_dewinvscalmt()

void bl1_dewinvscalmt ( trans1_t  trans,
int  m,
int  n,
double *  a,
int  a_rs,
int  a_cs,
double *  b,
int  b_rs,
int  b_cs 
)

References bl1_dewinvscalv(), bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

Referenced by FLA_Inv_scal_elemwise().

86 {
87  double* a_begin;
88  double* b_begin;
89  int lda, inca;
90  int ldb, incb;
91  int n_iter;
92  int n_elem;
93  int j;
94  conj1_t conj;
95 
96  // Return early if possible.
97  if ( bl1_zero_dim2( m, n ) ) return;
98 
99  // Handle cases where A and B are vectors to ensure that the underlying ewinvscal
100  // gets invoked only once.
101  if ( bl1_is_vector( m, n ) )
102  {
103  // Initialize with values appropriate for vectors.
104  n_iter = 1;
105  n_elem = bl1_vector_dim( m, n );
106  lda = 1; // multiplied by zero when n_iter == 1; not needed.
107  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
108  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
109  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
110  }
111  else // matrix case
112  {
113  // Initialize with optimal values for column-major storage.
114  n_iter = n;
115  n_elem = m;
116  lda = a_cs;
117  inca = a_rs;
118  ldb = b_cs;
119  incb = b_rs;
120 
121  // Handle the transposition of A.
122  if ( bl1_does_trans( trans ) )
123  {
124  bl1_swap_ints( lda, inca );
125  }
126 
127  // An optimization: if B is row-major and if A is effectively row-major
128  // after a possible transposition, then let's access the matrices by rows
129  // instead of by columns for increased spatial locality.
130  if ( bl1_is_row_storage( b_rs, b_cs ) )
131  {
132  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
133  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
134  {
135  bl1_swap_ints( n_iter, n_elem );
136  bl1_swap_ints( lda, inca );
137  bl1_swap_ints( ldb, incb );
138  }
139  }
140  }
141 
142  // Extract conj component from trans parameter.
143  conj = bl1_proj_trans1_to_conj( trans );
144 
145  for ( j = 0; j < n_iter; j++ )
146  {
147  a_begin = a + j*lda;
148  b_begin = b + j*ldb;
149 
150  bl1_dewinvscalv( conj,
151  n_elem,
152  a_begin, inca,
153  b_begin, incb );
154  }
155 }
int bl1_vector_dim(int m, int n)
Definition: bl1_vector.c:13
conj1_t
Definition: blis_type_defs.h:79
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
void bl1_dewinvscalv(conj1_t conj, int n, double *x, int incx, double *y, int incy)
Definition: bl1_ewinvscalv.c:28
int bl1_does_notrans(trans1_t trans)
Definition: bl1_does.c:19
int bl1_vector_inc(trans1_t trans, int m, int n, int rs, int cs)
Definition: bl1_vector.c:19
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
Definition: blis_type_defs.h:54
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition: bl1_proj.c:13
int bl1_is_vector(int m, int n)
Definition: bl1_is.c:106
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13

◆ bl1_dewinvscalv()

void bl1_dewinvscalv ( conj1_t  conj,
int  n,
double *  x,
int  incx,
double *  y,
int  incy 
)

References i.

Referenced by bl1_dewinvscalmt().

29 {
30  double* chi;
31  double* psi;
32  int i;
33 
34  for ( i = 0; i < n; ++i )
35  {
36  chi = x + i*incx;
37  psi = y + i*incy;
38 
39  bl1_dinvscals( chi, psi );
40  }
41 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_dewscalmt()

void bl1_dewscalmt ( trans1_t  trans,
int  m,
int  n,
double *  a,
int  a_rs,
int  a_cs,
double *  b,
int  b_rs,
int  b_cs 
)

References bl1_dewscalv(), bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

Referenced by FLA_Scal_elemwise().

86 {
87  double* a_begin;
88  double* b_begin;
89  int lda, inca;
90  int ldb, incb;
91  int n_iter;
92  int n_elem;
93  int j;
94  conj1_t conj;
95 
96  // Return early if possible.
97  if ( bl1_zero_dim2( m, n ) ) return;
98 
99  // Handle cases where A and B are vectors to ensure that the underlying ewscal
100  // gets invoked only once.
101  if ( bl1_is_vector( m, n ) )
102  {
103  // Initialize with values appropriate for vectors.
104  n_iter = 1;
105  n_elem = bl1_vector_dim( m, n );
106  lda = 1; // multiplied by zero when n_iter == 1; not needed.
107  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
108  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
109  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
110  }
111  else // matrix case
112  {
113  // Initialize with optimal values for column-major storage.
114  n_iter = n;
115  n_elem = m;
116  lda = a_cs;
117  inca = a_rs;
118  ldb = b_cs;
119  incb = b_rs;
120 
121  // Handle the transposition of A.
122  if ( bl1_does_trans( trans ) )
123  {
124  bl1_swap_ints( lda, inca );
125  }
126 
127  // An optimization: if B is row-major and if A is effectively row-major
128  // after a possible transposition, then let's access the matrices by rows
129  // instead of by columns for increased spatial locality.
130  if ( bl1_is_row_storage( b_rs, b_cs ) )
131  {
132  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
133  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
134  {
135  bl1_swap_ints( n_iter, n_elem );
136  bl1_swap_ints( lda, inca );
137  bl1_swap_ints( ldb, incb );
138  }
139  }
140  }
141 
142  // Extract conj component from trans parameter.
143  conj = bl1_proj_trans1_to_conj( trans );
144 
145  for ( j = 0; j < n_iter; j++ )
146  {
147  a_begin = a + j*lda;
148  b_begin = b + j*ldb;
149 
150  bl1_dewscalv( conj,
151  n_elem,
152  a_begin, inca,
153  b_begin, incb );
154  }
155 }
int bl1_vector_dim(int m, int n)
Definition: bl1_vector.c:13
conj1_t
Definition: blis_type_defs.h:79
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_does_notrans(trans1_t trans)
Definition: bl1_does.c:19
int bl1_vector_inc(trans1_t trans, int m, int n, int rs, int cs)
Definition: bl1_vector.c:19
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
Definition: blis_type_defs.h:54
void bl1_dewscalv(conj1_t conj, int n, double *x, int incx, double *y, int incy)
Definition: bl1_ewscalv.c:28
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition: bl1_proj.c:13
int bl1_is_vector(int m, int n)
Definition: bl1_is.c:106
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13

◆ bl1_dewscalv()

void bl1_dewscalv ( conj1_t  conj,
int  n,
double *  x,
int  incx,
double *  y,
int  incy 
)

References i.

Referenced by bl1_dapdiagmv(), and bl1_dewscalmt().

29 {
30  double* chi;
31  double* psi;
32  int i;
33 
34  for ( i = 0; i < n; ++i )
35  {
36  chi = x + i*incx;
37  psi = y + i*incy;
38 
39  bl1_dscals( chi, psi );
40  }
41 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_dfree()

void bl1_dfree ( double *  p)

◆ bl1_dfree_contigm()

void bl1_dfree_contigm ( double *  a_save,
int  a_rs_save,
int  a_cs_save,
double **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_dfree(), and bl1_is_gen_storage().

Referenced by bl1_dgemm(), bl1_dgemv(), bl1_dsymm(), bl1_dsymv(), bl1_dsyr2k(), bl1_dsyrk(), bl1_dtrmm(), bl1_dtrmmsx(), bl1_dtrmv(), bl1_dtrmvsx(), bl1_dtrsm(), bl1_dtrsmsx(), bl1_dtrsv(), and bl1_dtrsvsx().

30 {
31  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
32  {
33  // Free the temporary contiguous storage for the matrix.
34  bl1_dfree( *a );
35 
36  // Restore the original matrix address.
37  *a = a_save;
38 
39  // Restore the original row and column strides.
40  *a_rs = a_rs_save;
41  *a_cs = a_cs_save;
42  }
43 }
void bl1_dfree(double *p)
Definition: bl1_free.c:35
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100

◆ bl1_dfree_saved_contigm()

void bl1_dfree_saved_contigm ( int  m,
int  n,
double *  a_save,
int  a_rs_save,
int  a_cs_save,
double **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_dcopymt(), bl1_dfree(), bl1_is_gen_storage(), and BLIS1_NO_TRANSPOSE.

Referenced by bl1_dgemm(), bl1_dger(), bl1_dsymm(), bl1_dsyr(), bl1_dsyr2(), bl1_dtrmm(), bl1_dtrmmsx(), bl1_dtrsm(), and bl1_dtrsmsx().

37 {
38  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
39  {
40  // Copy the contents of the temporary matrix back to the original.
42  m,
43  n,
44  *a, *a_rs, *a_cs,
45  a_save, a_rs_save, a_cs_save );
46 
47  // Free the temporary contiguous storage for the matrix.
48  bl1_dfree( *a );
49 
50  // Restore the original matrix address.
51  *a = a_save;
52 
53  // Restore the original row and column strides.
54  *a_rs = a_rs_save;
55  *a_cs = a_cs_save;
56  }
57 }
void bl1_dfree(double *p)
Definition: bl1_free.c:35
void bl1_dcopymt(trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:148
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
Definition: blis_type_defs.h:54

◆ bl1_dfree_saved_contigmr()

void bl1_dfree_saved_contigmr ( uplo1_t  uplo,
int  m,
int  n,
double *  a_save,
int  a_rs_save,
int  a_cs_save,
double **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_dcopymr(), bl1_dfree(), and bl1_is_gen_storage().

Referenced by bl1_dsyr2k(), and bl1_dsyrk().

37 {
38  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
39  {
40  // Copy the contents of the temporary matrix back to the original.
41  bl1_dcopymr( uplo,
42  m,
43  n,
44  *a, *a_rs, *a_cs,
45  a_save, a_rs_save, a_cs_save );
46 
47  // Free the temporary contiguous storage for the matrix.
48  bl1_dfree( *a );
49 
50  // Restore the original matrix address.
51  *a = a_save;
52 
53  // Restore the original row and column strides.
54  *a_rs = a_rs_save;
55  *a_cs = a_cs_save;
56  }
57 }
void bl1_dfree(double *p)
Definition: bl1_free.c:35
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
void bl1_dcopymr(uplo1_t uplo, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:76

◆ bl1_dfree_saved_contigmsr()

void bl1_dfree_saved_contigmsr ( side1_t  side,
uplo1_t  uplo,
int  m,
int  n,
double *  a_save,
int  a_rs_save,
int  a_cs_save,
double **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_dcopymt(), bl1_dfree(), bl1_is_gen_storage(), and bl1_is_left().

43 {
44  int dim_a;
45 
46  // Choose the dimension of the matrix based on the side parameter.
47  if ( bl1_is_left( side ) ) dim_a = m;
48  else dim_a = n;
49 
50  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
51  {
52  // Copy the contents of the temporary matrix back to the original.
53  bl1_dcopymt( uplo,
54  dim_a,
55  dim_a,
56  *a, *a_rs, *a_cs,
57  a_save, a_rs_save, a_cs_save );
58 
59  // Free the temporary contiguous storage for the matrix.
60  bl1_dfree( *a );
61 
62  // Restore the original matrix address.
63  *a = a_save;
64 
65  // Restore the original row and column strides.
66  *a_rs = a_rs_save;
67  *a_cs = a_cs_save;
68  }
69 }
void bl1_dfree(double *p)
Definition: bl1_free.c:35
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61
void bl1_dcopymt(trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:148
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100

◆ bl1_dident()

void bl1_dident ( int  m,
double *  a,
int  a_rs,
int  a_cs 
)

References i.

Referenced by FLA_Bsvd_v_opd_var2(), FLA_Bsvd_v_opz_var2(), FLA_Tevd_v_opd_var2(), FLA_Tevd_v_opz_var2(), and FLA_UDdate_UT_opd_var1().

33 {
34  double* alpha;
35  int i, j;
36 
37  for ( j = 0; j < m; ++j )
38  {
39  for ( i = 0; i < m; ++i )
40  {
41  alpha = a + i*a_rs + j*a_cs;
42 
43  *alpha = 0.0;
44 
45  if ( i == j )
46  *alpha = 1.0;
47  }
48  }
49 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_dinvert2s()

void bl1_dinvert2s ( conj1_t  conj,
double *  alpha,
double *  beta 
)

Referenced by bl1_dinvscalm(), and bl1_zdinvscalm().

21 {
22  double one = 1.0;
23 
24  *beta = one / *alpha;
25 }

◆ bl1_dinverts()

void bl1_dinverts ( conj1_t  conj,
double *  alpha 
)

◆ bl1_dinvertv()

void bl1_dinvertv ( conj1_t  conj,
int  n,
double *  x,
int  incx 
)

References i.

Referenced by FLA_Invert().

28 {
29  double one = 1.0;
30  double* chi;
31  int i;
32 
33  for ( i = 0; i < n; ++i )
34  {
35  chi = x + i*incx;
36 
37  *chi = one / *chi;
38  }
39 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_dm1()

double bl1_dm1 ( void  )

◆ bl1_dm1h()

double bl1_dm1h ( void  )

Referenced by bl1_zm1h().

151 {
152  double x;
153  x = -0.5;
154  return x;
155 }

◆ bl1_dm2()

double bl1_dm2 ( void  )

Referenced by bl1_zm2().

215 {
216  double x;
217  x = -2.0;
218  return x;
219 }

◆ bl1_dmaxabsm()

void bl1_dmaxabsm ( int  m,
int  n,
double *  a,
int  a_rs,
int  a_cs,
double *  maxabs 
)

References bl1_d0(), bl1_dmaxabsv(), bl1_is_row_storage(), and bl1_zero_dim2().

Referenced by FLA_Max_abs_value().

59 {
60  double zero = bl1_d0();
61  double* a_begin;
62  double maxabs_cand;
63  double maxabs_temp;
64  int inca, lda;
65  int n_iter;
66  int n_elem;
67  int j;
68 
69  // Return early if possible.
70  if ( bl1_zero_dim2( m, n ) ) { *maxabs = zero; return; }
71 
72  // Initialize with optimal values for column-major storage.
73  inca = a_rs;
74  lda = a_cs;
75  n_iter = n;
76  n_elem = m;
77 
78  // An optimization: if A is row-major, then let's access the matrix by
79  // rows instead of by columns for increased spatial locality.
80  if ( bl1_is_row_storage( a_rs, a_cs ) )
81  {
82  bl1_swap_ints( n_iter, n_elem );
83  bl1_swap_ints( lda, inca );
84  }
85 
86  // Initialize the maximum absolute value candidate to the first element.
87  bl1_dabsval2( a, &maxabs_cand );
88 
89  for ( j = 0; j < n_iter; j++ )
90  {
91  a_begin = a + j*lda;
92 
93  bl1_dmaxabsv( n_elem,
94  a_begin, inca,
95  &maxabs_temp );
96 
97  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
98  }
99 
100  *maxabs = maxabs_cand;
101 }
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
double bl1_d0(void)
Definition: bl1_constants.c:118
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_dmaxabsv(int n, double *x, int incx, double *maxabs)
Definition: bl1_maxabsv.c:34

◆ bl1_dmaxabsmr()

void bl1_dmaxabsmr ( uplo1_t  uplo,
int  m,
int  n,
double *  a,
int  a_rs,
int  a_cs,
double *  maxabs 
)

References bl1_d0(), bl1_dmaxabsv(), bl1_is_row_storage(), bl1_is_upper(), and bl1_zero_dim2().

Referenced by FLA_Max_abs_value_herm().

79 {
80  double zero = bl1_d0();
81  double* a_begin;
82  double maxabs_cand;
83  double maxabs_temp;
84  int inca, lda;
85  int n_iter;
86  int n_elem_max;
87  int n_elem;
88  int j;
89 
90  // Return early if possible.
91  if ( bl1_zero_dim2( m, n ) ) { *maxabs = zero; return; }
92 
93  // Initialize with optimal values for column-major storage.
94  n_iter = n;
95  n_elem_max = m;
96  lda = a_cs;
97  inca = a_rs;
98 
99  // An optimization: if A is row-major, then let's access the matrix by
100  // rows instead of by columns for increased spatial locality.
101  if ( bl1_is_row_storage( a_rs, a_cs ) )
102  {
103  bl1_swap_ints( n_iter, n_elem_max );
104  bl1_swap_ints( lda, inca );
105  bl1_toggle_uplo( uplo );
106  }
107 
108  // Initialize the maximum absolute value candidate to the first element.
109  bl1_dabsval2( a, &maxabs_cand );
110 
111  if ( bl1_is_upper( uplo ) )
112  {
113  for ( j = 0; j < n_iter; j++ )
114  {
115  n_elem = bl1_min( j + 1, n_elem_max );
116  a_begin = a + j*lda;
117 
118  bl1_dmaxabsv( n_elem,
119  a_begin, inca,
120  &maxabs_temp );
121 
122  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
123  }
124  }
125  else // if ( bl1_is_lower( uplo ) )
126  {
127  for ( j = 0; j < n_iter; j++ )
128  {
129  n_elem = bl1_max( 0, n_elem_max - j );
130  a_begin = a + j*lda + j*inca;
131 
132  bl1_dmaxabsv( n_elem,
133  a_begin, inca,
134  &maxabs_temp );
135 
136  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
137  }
138  }
139 
140  *maxabs = maxabs_cand;
141 }
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
double bl1_d0(void)
Definition: bl1_constants.c:118
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_dmaxabsv(int n, double *x, int incx, double *maxabs)
Definition: bl1_maxabsv.c:34

◆ bl1_dmaxabsv()

void bl1_dmaxabsv ( int  n,
double *  x,
int  incx,
double *  maxabs 
)

References i.

Referenced by bl1_dmaxabsm(), and bl1_dmaxabsmr().

35 {
36  double* chi;
37  double maxabs_cand;
38  double maxabs_temp;
39  int i;
40 
41  bl1_dabsval2( x, &maxabs_cand );
42 
43  for ( i = 0; i < n; ++i )
44  {
45  chi = x + i*incx;
46 
47  bl1_dabsval2( chi, &maxabs_temp );
48 
49  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
50  }
51 
52  *maxabs = maxabs_cand;
53 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_drandm()

void bl1_drandm ( int  m,
int  n,
double *  a,
int  a_rs,
int  a_cs 
)

References bl1_drandv(), bl1_is_row_storage(), and bl1_zero_dim2().

Referenced by FLA_Random_matrix().

48 {
49  double* a_begin;
50  int inca, lda;
51  int n_iter;
52  int n_elem;
53  int j;
54 
55  // Return early if possible.
56  if ( bl1_zero_dim2( m, n ) ) return;
57 
58  // Initialize with optimal values for column-major storage.
59  inca = a_rs;
60  lda = a_cs;
61  n_iter = n;
62  n_elem = m;
63 
64  // An optimization: if A is row-major, then let's access the matrix by
65  // rows instead of by columns for increased spatial locality.
66  if ( bl1_is_row_storage( a_rs, a_cs ) )
67  {
68  bl1_swap_ints( n_iter, n_elem );
69  bl1_swap_ints( lda, inca );
70  }
71 
72  for ( j = 0; j < n_iter; j++ )
73  {
74  a_begin = a + j*lda;
75 
76  bl1_drandv( n_elem,
77  a_begin, inca );
78  }
79 }
void bl1_drandv(int n, double *x, int incx)
Definition: bl1_randv.c:26
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95

◆ bl1_drandmr()

void bl1_drandmr ( uplo1_t  uplo,
diag1_t  diag,
int  m,
int  n,
double *  a,
int  a_rs,
int  a_cs 
)

References bl1_d0(), bl1_d1(), bl1_dinvscalv(), bl1_drands(), bl1_drandv(), bl1_dsetv(), bl1_is_nonunit_diag(), bl1_is_row_storage(), bl1_is_unit_diag(), bl1_is_upper(), bl1_is_zero_diag(), bl1_zero_dim2(), and BLIS1_NO_CONJUGATE.

Referenced by FLA_Random_tri_matrix().

135 {
136  double* a_begin;
137  double* ajj;
138  double one;
139  double zero;
140  double ord;
141  int lda, inca;
142  int n_iter;
143  int n_elem_max;
144  int n_elem;
145  int j;
146 
147  // Return early if possible.
148  if ( bl1_zero_dim2( m, n ) ) return;
149 
150  // Initialize with optimal values for column-major storage.
151  n_iter = n;
152  n_elem_max = m;
153  lda = a_cs;
154  inca = a_rs;
155 
156  // An optimization: if A is row-major, then let's access the matrix by
157  // rows instead of by columns to increase spatial locality.
158  if ( bl1_is_row_storage( a_rs, a_cs ) )
159  {
160  bl1_swap_ints( n_iter, n_elem_max );
161  bl1_swap_ints( lda, inca );
162  bl1_toggle_uplo( uplo );
163  }
164 
165  // Initialize some scalars.
166  one = bl1_d1();
167  zero = bl1_d0();
168  ord = ( double ) bl1_max( m, n );
169 
170  if ( bl1_is_upper( uplo ) )
171  {
172  for ( j = 0; j < n_iter; j++ )
173  {
174  n_elem = bl1_min( j, n_elem_max );
175  a_begin = a + j*lda;
176 
177  // Randomize super-diagonal elements.
178  bl1_drandv( n_elem,
179  a_begin, inca );
180 
181  // Normalize super-diagonal elements by order of the matrix.
183  n_elem,
184  &ord,
185  a_begin, inca );
186 
187  // Initialize diagonal and sub-diagonal elements only if there are
188  // elements left in the column (ie: j < n_elem_max).
189  if ( j < n_elem_max )
190  {
191  ajj = a_begin + j*inca;
192 
193  // Initialize diagonal element.
194  if ( bl1_is_unit_diag( diag ) ) *ajj = one;
195  else if ( bl1_is_zero_diag( diag ) ) *ajj = zero;
196  else if ( bl1_is_nonunit_diag( diag ) )
197  {
198  // We want positive diagonal elements between 1 and 2.
199  bl1_drands( ajj );
200  bl1_dabsval2( ajj, ajj );
201  bl1_dadd3( ajj, &one, ajj );
202  }
203 
204  // Initialize sub-diagonal elements to zero.
205  bl1_dsetv( n_elem_max - j - 1,
206  &zero,
207  ajj + inca, inca );
208  }
209  }
210  }
211  else // if ( bl1_is_lower( uplo ) )
212  {
213  for ( j = 0; j < n_iter; j++ )
214  {
215  n_elem = bl1_min( j, n_elem_max );
216  a_begin = a + j*lda;
217 
218  // Initialize super-diagonal to zero.
219  bl1_dsetv( n_elem,
220  &zero,
221  a_begin, inca );
222 
223  // Initialize diagonal and sub-diagonal elements only if there are
224  // elements left in the column (ie: j < n_elem_max).
225  if ( j < n_elem_max )
226  {
227  ajj = a_begin + j*inca;
228 
229  // Initialize diagonal element.
230  if ( bl1_is_unit_diag( diag ) ) *ajj = one;
231  else if ( bl1_is_zero_diag( diag ) ) *ajj = zero;
232  else if ( bl1_is_nonunit_diag( diag ) )
233  {
234  // We want positive diagonal elements between 1 and 2.
235  bl1_drands( ajj );
236  bl1_dabsval2( ajj, ajj );
237  bl1_dadd3( ajj, &one, ajj );
238  }
239 
240  // Randomize sub-diagonal elements.
241  bl1_drandv( n_elem_max - j - 1,
242  ajj + inca, inca );
243 
244  // Normalize sub-diagonal elements by order of the matrix.
246  n_elem_max - j - 1,
247  &ord,
248  ajj + inca, inca );
249 
250  }
251  }
252  }
253 }
void bl1_drandv(int n, double *x, int incx)
Definition: bl1_randv.c:26
Definition: blis_type_defs.h:81
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
double bl1_d0(void)
Definition: bl1_constants.c:118
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
void bl1_dsetv(int m, double *sigma, double *x, int incx)
Definition: bl1_setv.c:39
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_dinvscalv(conj1_t conj, int n, double *alpha, double *x, int incx)
Definition: bl1_invscalv.c:26
int bl1_is_nonunit_diag(diag1_t diag)
Definition: bl1_is.c:73
int bl1_is_unit_diag(diag1_t diag)
Definition: bl1_is.c:78
int bl1_is_zero_diag(diag1_t diag)
Definition: bl1_is.c:83
void bl1_drands(double *alpha)
Definition: bl1_rands.c:18
double bl1_d1(void)
Definition: bl1_constants.c:54

◆ bl1_drands()

void bl1_drands ( double *  alpha)

Referenced by bl1_drandmr(), bl1_drandv(), and bl1_zrands().

19 {
20  *alpha = ( ( double ) rand() / ( ( double ) RAND_MAX / 2.0 ) ) - 1.0;
21 }

◆ bl1_drandv()

void bl1_drandv ( int  n,
double *  x,
int  incx 
)

References bl1_drands(), and i.

Referenced by bl1_drandm(), and bl1_drandmr().

27 {
28  double* chi;
29  int i;
30 
31  for ( i = 0; i < n; ++i )
32  {
33  chi = x + i*incx;
34 
35  bl1_drands( chi );
36  }
37 }
int i
Definition: bl1_axmyv2.c:145
void bl1_drands(double *alpha)
Definition: bl1_rands.c:18

◆ bl1_dscalediag()

void bl1_dscalediag ( conj1_t  conj,
int  offset,
int  m,
int  n,
double *  sigma,
double *  a,
int  a_rs,
int  a_cs 
)

References i.

Referenced by FLA_Scale_diag(), and FLA_UDdate_UT_opd_var1().

35 {
36  double* alpha;
37  int i, j;
38 
39  i = j = 0;
40 
41  if ( offset < 0 ) i = -offset;
42  else if ( offset > 0 ) j = offset;
43 
44  while ( i < m && j < n )
45  {
46  alpha = a + i*a_rs + j*a_cs;
47 
48  *alpha *= *sigma;
49 
50  ++i;
51  ++j;
52  }
53 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_dsetdiag()

void bl1_dsetdiag ( int  offset,
int  m,
int  n,
double *  sigma,
double *  a,
int  a_rs,
int  a_cs 
)

References i.

Referenced by FLA_Set_diag(), FLA_Set_offdiag(), and FLA_Triangularize().

56 {
57  double* alpha;
58  int i, j;
59 
60  i = j = 0;
61 
62  if ( offset < 0 ) i = -offset;
63  else if ( offset > 0 ) j = offset;
64 
65  while ( i < m && j < n )
66  {
67  alpha = a + i*a_rs + j*a_cs;
68 
69  *alpha = *sigma;
70 
71  ++i;
72  ++j;
73  }
74 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_dsetm()

void bl1_dsetm ( int  m,
int  n,
double *  sigma,
double *  a,
int  a_rs,
int  a_cs 
)

References i.

Referenced by FLA_Bidiag_UT_u_step_ofd_var4(), FLA_Bidiag_UT_u_step_opd_var4(), FLA_Bidiag_UT_u_step_opd_var5(), FLA_Hess_UT_step_ofd_var4(), FLA_Hess_UT_step_opd_var4(), FLA_Hess_UT_step_opd_var5(), FLA_Set(), FLA_Tridiag_UT_l_step_ofd_var3(), and FLA_Tridiag_UT_l_step_opd_var3().

46 {
47  double* alpha;
48  int i, j;
49 
50  for ( j = 0; j < n; ++j )
51  {
52  for ( i = 0; i < m; ++i )
53  {
54  alpha = a + i*a_rs + j*a_cs;
55 
56  *alpha = *sigma;
57  }
58  }
59 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_dsetmr()

void bl1_dsetmr ( uplo1_t  uplo,
int  m,
int  n,
double *  sigma,
double *  a,
int  a_rs,
int  a_cs 
)

References bl1_dsetv(), bl1_is_row_storage(), bl1_is_upper(), and bl1_zero_dim2().

Referenced by FLA_Setr(), and FLA_Triangularize().

67 {
68  double* a_begin;
69  int lda, inca;
70  int n_iter;
71  int n_elem_max;
72  int n_elem;
73  int j;
74 
75  // Return early if possible.
76  if ( bl1_zero_dim2( m, n ) ) return;
77 
78  // Initialize with optimal values for column-major storage.
79  n_iter = n;
80  n_elem_max = m;
81  lda = a_cs;
82  inca = a_rs;
83 
84  // An optimization: if A is row-major, then let's access the matrix by
85  // rows instead of by columns to increase spatial locality.
86  if ( bl1_is_row_storage( a_rs, a_cs ) )
87  {
88  bl1_swap_ints( n_iter, n_elem_max );
89  bl1_swap_ints( lda, inca );
90  bl1_toggle_uplo( uplo );
91  }
92 
93  if ( bl1_is_upper( uplo ) )
94  {
95  for ( j = 0; j < n_iter; j++ )
96  {
97  n_elem = bl1_min( j, n_elem_max );
98  a_begin = a + j*lda;
99 
100  bl1_dsetv( n_elem,
101  sigma,
102  a_begin, inca );
103  }
104  }
105  else // if ( bl1_is_lower( uplo ) )
106  {
107  for ( j = 0; j < n_iter; j++ )
108  {
109  n_elem = bl1_max( 0, n_elem_max - j - 1 );
110  a_begin = a + j*lda + (j + 1)*inca;
111 
112  bl1_dsetv( n_elem,
113  sigma,
114  a_begin, inca );
115  }
116  }
117 }
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
void bl1_dsetv(int m, double *sigma, double *x, int incx)
Definition: bl1_setv.c:39
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95

◆ bl1_dsetv()

void bl1_dsetv ( int  m,
double *  sigma,
double *  x,
int  incx 
)

◆ bl1_dshiftdiag()

void bl1_dshiftdiag ( conj1_t  conj,
int  offset,
int  m,
int  n,
double *  sigma,
double *  a,
int  a_rs,
int  a_cs 
)

References i.

Referenced by FLA_Lyap_h_opd_var1(), FLA_Lyap_h_opd_var2(), FLA_Lyap_h_opd_var3(), FLA_Lyap_h_opd_var4(), FLA_Lyap_n_opd_var1(), FLA_Lyap_n_opd_var2(), FLA_Lyap_n_opd_var3(), FLA_Lyap_n_opd_var4(), and FLA_Shift_diag().

35 {
36  double* alpha;
37  int i, j;
38 
39  i = j = 0;
40 
41  if ( offset < 0 ) i = -offset;
42  else if ( offset > 0 ) j = offset;
43 
44  while ( i < m && j < n )
45  {
46  alpha = a + i*a_rs + j*a_cs;
47 
48  *alpha += *sigma;
49 
50  ++i;
51  ++j;
52  }
53 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_dsymmize()

void bl1_dsymmize ( conj1_t  conj,
uplo1_t  uplo,
int  m,
double *  a,
int  a_rs,
int  a_cs 
)

References bl1_dcopyv(), bl1_is_col_storage(), bl1_is_gen_storage(), bl1_is_lower(), bl1_is_row_storage(), bl1_is_upper(), and bl1_zero_dim1().

Referenced by FLA_Hermitianize(), and FLA_Symmetrize().

125 {
126  double* a_src;
127  double* a_dst;
128  int rs_src, cs_src, inc_src;
129  int rs_dst, cs_dst, inc_dst;
130  int n_iter;
131  int j;
132 
133  // Return early if possible.
134  if ( bl1_zero_dim1( m ) ) return;
135 
136  // Assume A is square.
137  n_iter = m;
138 
139  // Initialize with appropriate values based on storage.
140  if ( bl1_is_col_storage( a_rs, a_cs ) && bl1_is_lower( uplo ) )
141  {
142  cs_src = 1;
143  rs_src = 0;
144  inc_src = a_cs;
145  cs_dst = a_cs;
146  rs_dst = 0;
147  inc_dst = 1;
148  }
149  else if ( bl1_is_col_storage( a_rs, a_cs ) && bl1_is_upper( uplo ) )
150  {
151  cs_src = a_cs;
152  rs_src = 0;
153  inc_src = 1;
154  cs_dst = 1;
155  rs_dst = 0;
156  inc_dst = a_cs;
157  }
158  else if ( bl1_is_row_storage( a_rs, a_cs ) && bl1_is_lower( uplo ) )
159  {
160  cs_src = 0;
161  rs_src = a_rs;
162  inc_src = 1;
163  cs_dst = 0;
164  rs_dst = 1;
165  inc_dst = a_rs;
166  }
167  else if ( bl1_is_row_storage( a_rs, a_cs ) && bl1_is_upper( uplo ) )
168  {
169  cs_src = 0;
170  rs_src = 1;
171  inc_src = a_rs;
172  cs_dst = 0;
173  rs_dst = a_rs;
174  inc_dst = 1;
175  }
176  else if ( bl1_is_gen_storage( a_rs, a_cs ) && bl1_is_lower( uplo ) )
177  {
178  // General stride with column-major tilt looks similar to column-major.
179  // General stride with row-major tilt looks similar to row-major.
180  if ( a_rs < a_cs )
181  {
182  cs_src = 1 * a_rs;
183  rs_src = 0;
184  inc_src = a_cs;
185  cs_dst = a_cs;
186  rs_dst = 0;
187  inc_dst = 1 * a_rs;
188  }
189  else // if ( a_rs > a_cs )
190  {
191  cs_src = 0;
192  rs_src = a_rs;
193  inc_src = 1 * a_cs;
194  cs_dst = 0;
195  rs_dst = 1 * a_cs;
196  inc_dst = a_rs;
197  }
198  }
199  else // if ( bl1_is_gen_storage( a_rs, a_cs ) && bl1_is_upper( uplo ) )
200  {
201  // General stride with column-major tilt looks similar to column-major.
202  // General stride with row-major tilt looks similar to row-major.
203  if ( a_rs < a_cs )
204  {
205  cs_src = a_cs;
206  rs_src = 0;
207  inc_src = 1 * a_rs;
208  cs_dst = 1 * a_rs;
209  rs_dst = 0;
210  inc_dst = a_cs;
211  }
212  else // if ( a_rs > a_cs )
213  {
214  cs_src = 0;
215  rs_src = 1 * a_cs;
216  inc_src = a_rs;
217  cs_dst = 0;
218  rs_dst = a_rs;
219  inc_dst = 1 * a_cs;
220  }
221  }
222 
223  for ( j = 0; j < n_iter; j++ )
224  {
225  a_src = a + j*cs_src + j*rs_src;
226  a_dst = a + j*cs_dst + j*rs_dst;
227 
228  bl1_dcopyv( conj,
229  j,
230  a_src, inc_src,
231  a_dst, inc_dst );
232  }
233 }
int bl1_is_lower(uplo1_t uplo)
Definition: bl1_is.c:49
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
int bl1_zero_dim1(int m)
Definition: bl1_is.c:113
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
void bl1_dcopyv(conj1_t conj, int m, double *x, int incx, double *y, int incy)
Definition: bl1_copyv.c:42

◆ bl1_iallocm()

int* bl1_iallocm ( unsigned int  m,
unsigned int  n 
)
26 {
27  return ( int* ) BLIS1_MALLOC( m * n * sizeof( int ) );
28 }

◆ bl1_iallocv()

int* bl1_iallocv ( unsigned int  n_elem)
26 {
27  return ( int* ) BLIS1_MALLOC( n_elem * sizeof( int ) );
28 }

◆ bl1_ifree()

void bl1_ifree ( int *  p)
26 {
27  free( ( int* ) p );
28 }

◆ bl1_isetdiag()

void bl1_isetdiag ( int  offset,
int  m,
int  n,
int *  sigma,
int *  a,
int  a_rs,
int  a_cs 
)

References i.

Referenced by FLA_Set_diag(), and FLA_Set_offdiag().

14 {
15  int* alpha;
16  int i, j;
17 
18  i = j = 0;
19 
20  if ( offset < 0 ) i = -offset;
21  else if ( offset > 0 ) j = offset;
22 
23  while ( i < m && j < n )
24  {
25  alpha = a + i*a_rs + j*a_cs;
26 
27  *alpha = *sigma;
28 
29  ++i;
30  ++j;
31  }
32 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_isetm()

void bl1_isetm ( int  m,
int  n,
int *  sigma,
int *  a,
int  a_rs,
int  a_cs 
)

References i.

Referenced by FLA_Set().

14 {
15  int* alpha;
16  int i, j;
17 
18  for ( j = 0; j < n; ++j )
19  {
20  for ( i = 0; i < m; ++i )
21  {
22  alpha = a + i*a_rs + j*a_cs;
23 
24  *alpha = *sigma;
25  }
26  }
27 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_isetv()

void bl1_isetv ( int  m,
int *  sigma,
int *  x,
int  incx 
)

References i.

14 {
15  int* chi;
16  int i;
17 
18  for ( i = 0; i < n; ++i )
19  {
20  chi = x + i*incx;
21 
22  *chi = *sigma;
23  }
24 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_s0()

float bl1_s0 ( void  )

◆ bl1_s1()

float bl1_s1 ( void  )

◆ bl1_s1h()

float bl1_s1h ( void  )

Referenced by bl1_c1h().

80 {
81  float x;
82  x = 0.5F;
83  return x;
84 }

◆ bl1_s2()

float bl1_s2 ( void  )

Referenced by bl1_c2().

16 {
17  float x;
18  x = 2.0F;
19  return x;
20 }

◆ bl1_sallocm()

float* bl1_sallocm ( unsigned int  m,
unsigned int  n 
)

Referenced by bl1_screate_contigm(), bl1_screate_contigmr(), bl1_screate_contigmt(), bl1_sgemm(), bl1_ssymm(), bl1_ssyr2k(), bl1_strmmsx(), and bl1_strsmsx().

31 {
32  return ( float* ) BLIS1_MALLOC( m * n * sizeof( float ) );
33 }

◆ bl1_sallocv()

float* bl1_sallocv ( unsigned int  n_elem)

Referenced by bl1_strmvsx(), and bl1_strsvsx().

31 {
32  return ( float* ) BLIS1_MALLOC( n_elem * sizeof( float ) );
33 }

◆ bl1_sapdiagmv()

void bl1_sapdiagmv ( side1_t  side,
conj1_t  conj,
int  m,
int  n,
float *  x,
int  incx,
float *  a,
int  a_rs,
int  a_cs 
)

References bl1_is_left(), bl1_is_row_storage(), bl1_sewscalv(), bl1_sscalv(), and bl1_zero_dim2().

Referenced by FLA_Apply_diag_matrix().

14 {
15  float* chi;
16  float* a_begin;
17  int inca, lda;
18  int n_iter;
19  int n_elem;
20  int j;
21 
22  // Return early if possible.
23  if ( bl1_zero_dim2( m, n ) ) return;
24 
25  // Initialize with optimal values for column-major storage.
26  inca = a_rs;
27  lda = a_cs;
28  n_iter = n;
29  n_elem = m;
30 
31  // An optimization: if A is row-major, then we can proceed as if the
32  // operation were transposed (applying the diagonal values in x from the
33  // opposite side) for increased spatial locality.
34  if ( bl1_is_row_storage( a_rs, a_cs ) )
35  {
36  bl1_swap_ints( n_iter, n_elem );
37  bl1_swap_ints( lda, inca );
38  bl1_toggle_side( side );
39  }
40 
41  if ( bl1_is_left( side ) )
42  {
43  for ( j = 0; j < n_iter; j++ )
44  {
45  a_begin = a + j*lda;
46 
47  bl1_sewscalv( conj,
48  n_elem,
49  x, incx,
50  a_begin, inca );
51  }
52  }
53  else
54  {
55  for ( j = 0; j < n_iter; j++ )
56  {
57  a_begin = a + j*lda;
58  chi = x + j*incx;
59 
60  bl1_sscalv( conj,
61  n_elem,
62  chi,
63  a_begin, inca );
64  }
65  }
66 }
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_sewscalv(conj1_t conj, int n, float *x, int incx, float *y, int incy)
Definition: bl1_ewscalv.c:13
void bl1_sscalv(conj1_t conj, int n, float *alpha, float *x, int incx)
Definition: bl1_scalv.c:13

◆ bl1_screate_contigm()

void bl1_screate_contigm ( int  m,
int  n,
float *  a_save,
int  a_rs_save,
int  a_cs_save,
float **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_is_gen_storage(), bl1_sallocm(), bl1_scopymt(), bl1_set_contig_strides(), and BLIS1_NO_TRANSPOSE.

Referenced by bl1_sgemm(), bl1_sgemv(), bl1_sger(), bl1_ssymm(), bl1_strmm(), bl1_strmmsx(), bl1_strsm(), and bl1_strsmsx().

14 {
15  int m_contig, n_contig;
16 
17  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
18  {
19  // Initialize dimensions assuming no transposition needed during copy.
20  m_contig = m;
21  n_contig = n;
22 
23 /*
24  // Transpose the dimensions of the contiguous matrix, if requested.
25  if ( bl1_does_trans( trans_copy ) )
26  {
27  m_contig = n;
28  n_contig = m;
29  }
30 */
31 
32  // Allocate temporary contiguous storage for the matrix.
33  *a = bl1_sallocm( m_contig, n_contig );
34 
35  // Set the row and column strides for the temporary matrix.
36  bl1_set_contig_strides( m_contig, n_contig, a_rs, a_cs );
37 
38  // Initialize the contiguous matrix with the contents of the original.
40  m_contig,
41  n_contig,
42  a_save, a_rs_save, a_cs_save,
43  *a, *a_rs, *a_cs );
44  }
45 }
float * bl1_sallocm(unsigned int m, unsigned int n)
Definition: bl1_allocm.c:30
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
Definition: blis_type_defs.h:54
void bl1_scopymt(trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:81
void bl1_set_contig_strides(int m, int n, int *rs, int *cs)
Definition: bl1_set_contig_strides.c:13

◆ bl1_screate_contigmr()

void bl1_screate_contigmr ( uplo1_t  uplo,
int  m,
int  n,
float *  a_save,
int  a_rs_save,
int  a_cs_save,
float **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_is_gen_storage(), bl1_sallocm(), bl1_scopymr(), and bl1_set_contig_strides().

Referenced by bl1_screate_contigmsr(), bl1_ssymm(), bl1_ssymv(), bl1_ssyr(), bl1_ssyr2(), bl1_ssyr2k(), bl1_ssyrk(), bl1_strmm(), bl1_strmmsx(), bl1_strmv(), bl1_strmvsx(), bl1_strsm(), bl1_strsmsx(), bl1_strsv(), and bl1_strsvsx().

14 {
15  int m_contig, n_contig;
16 
17  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
18  {
19  // Initialize dimensions assuming no transposition needed during copy.
20  m_contig = m;
21  n_contig = n;
22 /*
23  // Transpose the dimensions of the contiguous matrix, if requested.
24  if ( bl1_does_trans( trans_copy ) )
25  {
26  m_contig = n;
27  n_contig = m;
28  }
29 */
30  // Allocate temporary contiguous storage for the matrix.
31  *a = bl1_sallocm( m_contig, n_contig );
32 
33  // Set the row and column strides for the temporary matrix.
34  bl1_set_contig_strides( m_contig, n_contig, a_rs, a_cs );
35 
36  // Initialize the contiguous matrix with the contents of the original.
37  bl1_scopymr( uplo,
38  m_contig,
39  n_contig,
40  a_save, a_rs_save, a_cs_save,
41  *a, *a_rs, *a_cs );
42  }
43 }
float * bl1_sallocm(unsigned int m, unsigned int n)
Definition: bl1_allocm.c:30
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
void bl1_scopymr(uplo1_t uplo, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:13
void bl1_set_contig_strides(int m, int n, int *rs, int *cs)
Definition: bl1_set_contig_strides.c:13

◆ bl1_screate_contigmsr()

void bl1_screate_contigmsr ( side1_t  side,
uplo1_t  uplo,
int  m,
int  n,
float *  a_save,
int  a_rs_save,
int  a_cs_save,
float **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_is_left(), and bl1_screate_contigmr().

14 {
15  int dim_a;
16 
17  // Choose the dimension of the matrix based on the side parameter.
18  if ( bl1_is_left( side ) ) dim_a = m;
19  else dim_a = n;
20 
21  // Call the simple version with chosen dimensions.
23  dim_a,
24  dim_a,
25  a_save, a_rs_save, a_cs_save,
26  a, a_rs, a_cs );
27 }
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61
void bl1_screate_contigmr(uplo1_t uplo, int m, int n, float *a_save, int a_rs_save, int a_cs_save, float **a, int *a_rs, int *a_cs)
Definition: bl1_create_contigmr.c:13

◆ bl1_screate_contigmt()

void bl1_screate_contigmt ( trans1_t  trans_dims,
int  m,
int  n,
float *  a_save,
int  a_rs_save,
int  a_cs_save,
float **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_does_trans(), bl1_is_gen_storage(), bl1_sallocm(), bl1_scopymt(), bl1_set_contig_strides(), and BLIS1_NO_TRANSPOSE.

Referenced by bl1_sgemm(), bl1_ssyr2k(), and bl1_ssyrk().

14 {
15  int m_contig, n_contig;
16 
17  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
18  {
19  // Transpose the dimensions if requested.
20  if ( bl1_does_trans( trans_dims ) )
21  bl1_swap_ints( m, n );
22 
23  // Initialize dimensions assuming no transposition needed during copy.
24  m_contig = m;
25  n_contig = n;
26 
27 /*
28  // Transpose the dimensions of the contiguous matrix, if requested.
29  if ( bl1_does_trans( trans_copy ) )
30  {
31  m_contig = n;
32  n_contig = m;
33  }
34 */
35 
36  // Allocate temporary contiguous storage for the matrix.
37  *a = bl1_sallocm( m_contig, n_contig );
38 
39  // Set the row and column strides for the temporary matrix.
40  bl1_set_contig_strides( m_contig, n_contig, a_rs, a_cs );
41 
42  // Initialize the contiguous matrix with the contents of the original.
44  m_contig,
45  n_contig,
46  a_save, a_rs_save, a_cs_save,
47  *a, *a_rs, *a_cs );
48  }
49 }
float * bl1_sallocm(unsigned int m, unsigned int n)
Definition: bl1_allocm.c:30
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
Definition: blis_type_defs.h:54
void bl1_scopymt(trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:81
void bl1_set_contig_strides(int m, int n, int *rs, int *cs)
Definition: bl1_set_contig_strides.c:13
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13

◆ bl1_set_contig_strides()

void bl1_set_contig_strides ( int  m,
int  n,
int *  rs,
int *  cs 
)

Referenced by bl1_ccreate_contigm(), bl1_ccreate_contigmr(), bl1_ccreate_contigmt(), bl1_dcreate_contigm(), bl1_dcreate_contigmr(), bl1_dcreate_contigmt(), bl1_screate_contigm(), bl1_screate_contigmr(), bl1_screate_contigmt(), bl1_zcreate_contigm(), bl1_zcreate_contigmr(), and bl1_zcreate_contigmt().

14 {
15  // Default to column-major order.
16  *rs = 1;
17  *cs = m;
18 
19  // Handle special cases first.
20  // Check the strides, and modify them if needed.
21  if ( *rs == 1 && *cs == 1 )
22  {
23  // If both strides are unit, we are probably trying to create a
24  // 1-by-n matrix in column-major order, or an m-by-1 matrix in
25  // row-major order. We have decided to "reserve" the case where
26  // rs == cs == 1 for scalars only, as having unit strides can
27  // upset the BLAS error checking when attempting to induce a
28  // row-major operation.
29  if ( m > 1 && n == 1 )
30  {
31  // Set the column stride to indicate that this is an m-by-1
32  // matrix (or vector) stored in column-major order. This is
33  // necessary because, in some cases, we have to satisfy error
34  // checking in the underlying BLAS library, which expects the
35  // leading dimension to be set to at least m, even if it will
36  // never be used for indexing since there is only one column
37  // of data. Note that rs is already set to 1.
38  *cs = m;
39  }
40  else if ( m == 1 && 1 < n )
41  {
42  // Set the row stride to indicate that this is a 1-by-n matrix
43  // stored in row-major order. Note that cs is already set to 1.
44  *rs = n;
45  }
46  else
47  {
48  // If m == n == 1, then we are dealing with a scalar. Since rs
49  // and cs do not exceed m and n, we don't have to do anything.
50  }
51  }
52 }

◆ bl1_set_dim_with_side()

void bl1_set_dim_with_side ( side1_t  side,
int  m,
int  n,
int *  dim_new 
)

References bl1_is_left().

Referenced by bl1_chemm(), bl1_csymm(), bl1_ctrmm(), bl1_ctrmmsx(), bl1_ctrsm(), bl1_ctrsmsx(), bl1_dsymm(), bl1_dtrmm(), bl1_dtrmmsx(), bl1_dtrsm(), bl1_dtrsmsx(), bl1_ssymm(), bl1_strmm(), bl1_strmmsx(), bl1_strsm(), bl1_strsmsx(), bl1_zhemm(), bl1_zsymm(), bl1_ztrmm(), bl1_ztrmmsx(), bl1_ztrsm(), and bl1_ztrsmsx().

28 {
29  if ( bl1_is_left( side ) )
30  {
31  *dim_new = m;
32  }
33  else // if ( bl1_is_right( side ) )
34  {
35  *dim_new = n;
36  }
37 }
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61

◆ bl1_set_dims_with_trans()

void bl1_set_dims_with_trans ( trans1_t  trans,
int  m,
int  n,
int *  m_new,
int *  n_new 
)

References bl1_does_trans().

Referenced by bl1_cher2k(), bl1_csyr2k(), bl1_dsyr2k(), bl1_ssyr2k(), bl1_zher2k(), and bl1_zsyr2k().

14 {
15  if ( bl1_does_trans( trans ) )
16  {
17  *m_new = n;
18  *n_new = m;
19  }
20  else
21  {
22  *m_new = m;
23  *n_new = n;
24  }
25 }
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13

◆ bl1_sewinvscalmt()

void bl1_sewinvscalmt ( trans1_t  trans,
int  m,
int  n,
float *  a,
int  a_rs,
int  a_cs,
float *  b,
int  b_rs,
int  b_cs 
)

References bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_sewinvscalv(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

Referenced by FLA_Inv_scal_elemwise().

14 {
15  float* a_begin;
16  float* b_begin;
17  int lda, inca;
18  int ldb, incb;
19  int n_iter;
20  int n_elem;
21  int j;
22  conj1_t conj;
23 
24  // Return early if possible.
25  if ( bl1_zero_dim2( m, n ) ) return;
26 
27  // Handle cases where A and B are vectors to ensure that the underlying ewinvscal
28  // gets invoked only once.
29  if ( bl1_is_vector( m, n ) )
30  {
31  // Initialize with values appropriate for vectors.
32  n_iter = 1;
33  n_elem = bl1_vector_dim( m, n );
34  lda = 1; // multiplied by zero when n_iter == 1; not needed.
35  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
36  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
37  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
38  }
39  else // matrix case
40  {
41  // Initialize with optimal values for column-major storage.
42  n_iter = n;
43  n_elem = m;
44  lda = a_cs;
45  inca = a_rs;
46  ldb = b_cs;
47  incb = b_rs;
48 
49  // Handle the transposition of A.
50  if ( bl1_does_trans( trans ) )
51  {
52  bl1_swap_ints( lda, inca );
53  }
54 
55  // An optimization: if B is row-major and if A is effectively row-major
56  // after a possible transposition, then let's access the matrices by rows
57  // instead of by columns for increased spatial locality.
58  if ( bl1_is_row_storage( b_rs, b_cs ) )
59  {
60  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
61  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
62  {
63  bl1_swap_ints( n_iter, n_elem );
64  bl1_swap_ints( lda, inca );
65  bl1_swap_ints( ldb, incb );
66  }
67  }
68  }
69 
70  // Extract conj component from trans parameter.
71  conj = bl1_proj_trans1_to_conj( trans );
72 
73  for ( j = 0; j < n_iter; j++ )
74  {
75  a_begin = a + j*lda;
76  b_begin = b + j*ldb;
77 
78  bl1_sewinvscalv( conj,
79  n_elem,
80  a_begin, inca,
81  b_begin, incb );
82  }
83 }
int bl1_vector_dim(int m, int n)
Definition: bl1_vector.c:13
conj1_t
Definition: blis_type_defs.h:79
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_does_notrans(trans1_t trans)
Definition: bl1_does.c:19
int bl1_vector_inc(trans1_t trans, int m, int n, int rs, int cs)
Definition: bl1_vector.c:19
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
Definition: blis_type_defs.h:54
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition: bl1_proj.c:13
int bl1_is_vector(int m, int n)
Definition: bl1_is.c:106
void bl1_sewinvscalv(conj1_t conj, int n, float *x, int incx, float *y, int incy)
Definition: bl1_ewinvscalv.c:13
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13

◆ bl1_sewinvscalv()

void bl1_sewinvscalv ( conj1_t  conj,
int  n,
float *  x,
int  incx,
float *  y,
int  incy 
)

References i.

Referenced by bl1_sewinvscalmt().

14 {
15  float* chi;
16  float* psi;
17  int i;
18 
19  for ( i = 0; i < n; ++i )
20  {
21  chi = x + i*incx;
22  psi = y + i*incy;
23 
24  bl1_sinvscals( chi, psi );
25  }
26 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_sewscalmt()

void bl1_sewscalmt ( trans1_t  trans,
int  m,
int  n,
float *  a,
int  a_rs,
int  a_cs,
float *  b,
int  b_rs,
int  b_cs 
)

References bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_sewscalv(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

Referenced by FLA_Scal_elemwise().

14 {
15  float* a_begin;
16  float* b_begin;
17  int lda, inca;
18  int ldb, incb;
19  int n_iter;
20  int n_elem;
21  int j;
22  conj1_t conj;
23 
24  // Return early if possible.
25  if ( bl1_zero_dim2( m, n ) ) return;
26 
27  // Handle cases where A and B are vectors to ensure that the underlying ewscal
28  // gets invoked only once.
29  if ( bl1_is_vector( m, n ) )
30  {
31  // Initialize with values appropriate for vectors.
32  n_iter = 1;
33  n_elem = bl1_vector_dim( m, n );
34  lda = 1; // multiplied by zero when n_iter == 1; not needed.
35  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
36  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
37  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
38  }
39  else // matrix case
40  {
41  // Initialize with optimal values for column-major storage.
42  n_iter = n;
43  n_elem = m;
44  lda = a_cs;
45  inca = a_rs;
46  ldb = b_cs;
47  incb = b_rs;
48 
49  // Handle the transposition of A.
50  if ( bl1_does_trans( trans ) )
51  {
52  bl1_swap_ints( lda, inca );
53  }
54 
55  // An optimization: if B is row-major and if A is effectively row-major
56  // after a possible transposition, then let's access the matrices by rows
57  // instead of by columns for increased spatial locality.
58  if ( bl1_is_row_storage( b_rs, b_cs ) )
59  {
60  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
61  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
62  {
63  bl1_swap_ints( n_iter, n_elem );
64  bl1_swap_ints( lda, inca );
65  bl1_swap_ints( ldb, incb );
66  }
67  }
68  }
69 
70  // Extract conj component from trans parameter.
71  conj = bl1_proj_trans1_to_conj( trans );
72 
73  for ( j = 0; j < n_iter; j++ )
74  {
75  a_begin = a + j*lda;
76  b_begin = b + j*ldb;
77 
78  bl1_sewscalv( conj,
79  n_elem,
80  a_begin, inca,
81  b_begin, incb );
82  }
83 }
int bl1_vector_dim(int m, int n)
Definition: bl1_vector.c:13
conj1_t
Definition: blis_type_defs.h:79
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_does_notrans(trans1_t trans)
Definition: bl1_does.c:19
int bl1_vector_inc(trans1_t trans, int m, int n, int rs, int cs)
Definition: bl1_vector.c:19
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
Definition: blis_type_defs.h:54
void bl1_sewscalv(conj1_t conj, int n, float *x, int incx, float *y, int incy)
Definition: bl1_ewscalv.c:13
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition: bl1_proj.c:13
int bl1_is_vector(int m, int n)
Definition: bl1_is.c:106
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13

◆ bl1_sewscalv()

void bl1_sewscalv ( conj1_t  conj,
int  n,
float *  x,
int  incx,
float *  y,
int  incy 
)

References i.

Referenced by bl1_sapdiagmv(), and bl1_sewscalmt().

14 {
15  float* chi;
16  float* psi;
17  int i;
18 
19  for ( i = 0; i < n; ++i )
20  {
21  chi = x + i*incx;
22  psi = y + i*incy;
23 
24  bl1_sscals( chi, psi );
25  }
26 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_sfree()

void bl1_sfree ( float *  p)

◆ bl1_sfree_contigm()

void bl1_sfree_contigm ( float *  a_save,
int  a_rs_save,
int  a_cs_save,
float **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_is_gen_storage(), and bl1_sfree().

Referenced by bl1_sgemm(), bl1_sgemv(), bl1_ssymm(), bl1_ssymv(), bl1_ssyr2k(), bl1_ssyrk(), bl1_strmm(), bl1_strmmsx(), bl1_strmv(), bl1_strmvsx(), bl1_strsm(), bl1_strsmsx(), bl1_strsv(), and bl1_strsvsx().

14 {
15  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
16  {
17  // Free the temporary contiguous storage for the matrix.
18  bl1_sfree( *a );
19 
20  // Restore the original matrix address.
21  *a = a_save;
22 
23  // Restore the original row and column strides.
24  *a_rs = a_rs_save;
25  *a_cs = a_cs_save;
26  }
27 }
void bl1_sfree(float *p)
Definition: bl1_free.c:30
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100

◆ bl1_sfree_saved_contigm()

void bl1_sfree_saved_contigm ( int  m,
int  n,
float *  a_save,
int  a_rs_save,
int  a_cs_save,
float **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_is_gen_storage(), bl1_scopymt(), bl1_sfree(), and BLIS1_NO_TRANSPOSE.

Referenced by bl1_sgemm(), bl1_sger(), bl1_ssymm(), bl1_ssyr(), bl1_ssyr2(), bl1_strmm(), bl1_strmmsx(), bl1_strsm(), and bl1_strsmsx().

14 {
15  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
16  {
17  // Copy the contents of the temporary matrix back to the original.
19  m,
20  n,
21  *a, *a_rs, *a_cs,
22  a_save, a_rs_save, a_cs_save );
23 
24  // Free the temporary contiguous storage for the matrix.
25  bl1_sfree( *a );
26 
27  // Restore the original matrix address.
28  *a = a_save;
29 
30  // Restore the original row and column strides.
31  *a_rs = a_rs_save;
32  *a_cs = a_cs_save;
33  }
34 }
void bl1_sfree(float *p)
Definition: bl1_free.c:30
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
Definition: blis_type_defs.h:54
void bl1_scopymt(trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:81

◆ bl1_sfree_saved_contigmr()

void bl1_sfree_saved_contigmr ( uplo1_t  uplo,
int  m,
int  n,
float *  a_save,
int  a_rs_save,
int  a_cs_save,
float **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_is_gen_storage(), bl1_scopymr(), and bl1_sfree().

Referenced by bl1_ssyr2k(), and bl1_ssyrk().

14 {
15  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
16  {
17  // Copy the contents of the temporary matrix back to the original.
18  bl1_scopymr( uplo,
19  m,
20  n,
21  *a, *a_rs, *a_cs,
22  a_save, a_rs_save, a_cs_save );
23 
24  // Free the temporary contiguous storage for the matrix.
25  bl1_sfree( *a );
26 
27  // Restore the original matrix address.
28  *a = a_save;
29 
30  // Restore the original row and column strides.
31  *a_rs = a_rs_save;
32  *a_cs = a_cs_save;
33  }
34 }
void bl1_sfree(float *p)
Definition: bl1_free.c:30
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
void bl1_scopymr(uplo1_t uplo, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:13

◆ bl1_sfree_saved_contigmsr()

void bl1_sfree_saved_contigmsr ( side1_t  side,
uplo1_t  uplo,
int  m,
int  n,
float *  a_save,
int  a_rs_save,
int  a_cs_save,
float **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_is_gen_storage(), bl1_is_left(), bl1_scopymt(), and bl1_sfree().

14 {
15  int dim_a;
16 
17  // Choose the dimension of the matrix based on the side parameter.
18  if ( bl1_is_left( side ) ) dim_a = m;
19  else dim_a = n;
20 
21  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
22  {
23  // Copy the contents of the temporary matrix back to the original.
24  bl1_scopymt( uplo,
25  dim_a,
26  dim_a,
27  *a, *a_rs, *a_cs,
28  a_save, a_rs_save, a_cs_save );
29 
30  // Free the temporary contiguous storage for the matrix.
31  bl1_sfree( *a );
32 
33  // Restore the original matrix address.
34  *a = a_save;
35 
36  // Restore the original row and column strides.
37  *a_rs = a_rs_save;
38  *a_cs = a_cs_save;
39  }
40 }
void bl1_sfree(float *p)
Definition: bl1_free.c:30
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
void bl1_scopymt(trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:81

◆ bl1_sident()

void bl1_sident ( int  m,
float *  a,
int  a_rs,
int  a_cs 
)

References i.

Referenced by FLA_UDdate_UT_ops_var1().

14 {
15  float* alpha;
16  int i, j;
17 
18  for ( j = 0; j < m; ++j )
19  {
20  for ( i = 0; i < m; ++i )
21  {
22  alpha = a + i*a_rs + j*a_cs;
23 
24  *alpha = 0.0F;
25 
26  if ( i == j )
27  *alpha = 1.0F;
28  }
29  }
30 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_sinvert2s()

void bl1_sinvert2s ( conj1_t  conj,
float *  alpha,
float *  beta 
)

Referenced by bl1_csinvscalm(), and bl1_sinvscalm().

14 {
15  float one = 1.0F;
16 
17  *beta = one / *alpha;
18 }

◆ bl1_sinverts()

void bl1_sinverts ( conj1_t  conj,
float *  alpha 
)

◆ bl1_sinvertv()

void bl1_sinvertv ( conj1_t  conj,
int  n,
float *  x,
int  incx 
)

References i.

Referenced by FLA_Invert().

14 {
15  float one = 1.0F;
16  float* chi;
17  int i;
18 
19  for ( i = 0; i < n; ++i )
20  {
21  chi = x + i*incx;
22 
23  *chi = one / *chi;
24  }
25 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_sm1()

float bl1_sm1 ( void  )

Referenced by bl1_cconjm(), bl1_cconjmr(), bl1_cconjv(), bl1_cm1(), FLA_Bsvd_ext_opc_var1(), FLA_Bsvd_ext_ops_var1(), FLA_Bsvd_v_opc_var1(), and FLA_Bsvd_v_ops_var1().

176 {
177  float x;
178  x = -1.0F;
179  return x;
180 }

◆ bl1_sm1h()

float bl1_sm1h ( void  )

Referenced by bl1_cm1h().

144 {
145  float x;
146  x = -0.5F;
147  return x;
148 }

◆ bl1_sm2()

float bl1_sm2 ( void  )

Referenced by bl1_cm2().

208 {
209  float x;
210  x = -2.0F;
211  return x;
212 }

◆ bl1_smaxabsm()

void bl1_smaxabsm ( int  m,
int  n,
float *  a,
int  a_rs,
int  a_cs,
float *  maxabs 
)

References bl1_is_row_storage(), bl1_s0(), bl1_smaxabsv(), and bl1_zero_dim2().

Referenced by FLA_Max_abs_value().

14 {
15  float zero = bl1_s0();
16  float* a_begin;
17  float maxabs_cand;
18  float maxabs_temp;
19  int inca, lda;
20  int n_iter;
21  int n_elem;
22  int j;
23 
24  // Return early if possible.
25  if ( bl1_zero_dim2( m, n ) ) { *maxabs = zero; return; }
26 
27  // Initialize with optimal values for column-major storage.
28  inca = a_rs;
29  lda = a_cs;
30  n_iter = n;
31  n_elem = m;
32 
33  // An optimization: if A is row-major, then let's access the matrix by
34  // rows instead of by columns for increased spatial locality.
35  if ( bl1_is_row_storage( a_rs, a_cs ) )
36  {
37  bl1_swap_ints( n_iter, n_elem );
38  bl1_swap_ints( lda, inca );
39  }
40 
41  // Initialize the maximum absolute value candidate to the first element.
42  bl1_sabsval2( a, &maxabs_cand );
43 
44  for ( j = 0; j < n_iter; j++ )
45  {
46  a_begin = a + j*lda;
47 
48  bl1_smaxabsv( n_elem,
49  a_begin, inca,
50  &maxabs_temp );
51 
52  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
53  }
54 
55  *maxabs = maxabs_cand;
56 }
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_smaxabsv(int n, float *x, int incx, float *maxabs)
Definition: bl1_maxabsv.c:13
float bl1_s0(void)
Definition: bl1_constants.c:111

◆ bl1_smaxabsmr()

void bl1_smaxabsmr ( uplo1_t  uplo,
int  m,
int  n,
float *  a,
int  a_rs,
int  a_cs,
float *  maxabs 
)

References bl1_is_row_storage(), bl1_is_upper(), bl1_s0(), bl1_smaxabsv(), and bl1_zero_dim2().

Referenced by FLA_Max_abs_value_herm().

14 {
15  float zero = bl1_s0();
16  float* a_begin;
17  float maxabs_cand;
18  float maxabs_temp;
19  int inca, lda;
20  int n_iter;
21  int n_elem_max;
22  int n_elem;
23  int j;
24 
25  // Return early if possible.
26  if ( bl1_zero_dim2( m, n ) ) { *maxabs = zero; return; }
27 
28  // Initialize with optimal values for column-major storage.
29  n_iter = n;
30  n_elem_max = m;
31  lda = a_cs;
32  inca = a_rs;
33 
34  // An optimization: if A is row-major, then let's access the matrix by
35  // rows instead of by columns for increased spatial locality.
36  if ( bl1_is_row_storage( a_rs, a_cs ) )
37  {
38  bl1_swap_ints( n_iter, n_elem_max );
39  bl1_swap_ints( lda, inca );
40  bl1_toggle_uplo( uplo );
41  }
42 
43  // Initialize the maximum absolute value candidate to the first element.
44  bl1_sabsval2( a, &maxabs_cand );
45 
46  if ( bl1_is_upper( uplo ) )
47  {
48  for ( j = 0; j < n_iter; j++ )
49  {
50  n_elem = bl1_min( j + 1, n_elem_max );
51  a_begin = a + j*lda;
52 
53  bl1_smaxabsv( n_elem,
54  a_begin, inca,
55  &maxabs_temp );
56 
57  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
58  }
59  }
60  else // if ( bl1_is_lower( uplo ) )
61  {
62  for ( j = 0; j < n_iter; j++ )
63  {
64  n_elem = bl1_max( 0, n_elem_max - j );
65  a_begin = a + j*lda + j*inca;
66 
67  bl1_smaxabsv( n_elem,
68  a_begin, inca,
69  &maxabs_temp );
70 
71  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
72  }
73  }
74 
75  *maxabs = maxabs_cand;
76 }
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_smaxabsv(int n, float *x, int incx, float *maxabs)
Definition: bl1_maxabsv.c:13
float bl1_s0(void)
Definition: bl1_constants.c:111

◆ bl1_smaxabsv()

void bl1_smaxabsv ( int  n,
float *  x,
int  incx,
float *  maxabs 
)

References i.

Referenced by bl1_smaxabsm(), and bl1_smaxabsmr().

14 {
15  float* chi;
16  float maxabs_cand;
17  float maxabs_temp;
18  int i;
19 
20  bl1_sabsval2( x, &maxabs_cand );
21 
22  for ( i = 0; i < n; ++i )
23  {
24  chi = x + i*incx;
25 
26  bl1_sabsval2( chi, &maxabs_temp );
27 
28  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
29  }
30 
31  *maxabs = maxabs_cand;
32 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_srandm()

void bl1_srandm ( int  m,
int  n,
float *  a,
int  a_rs,
int  a_cs 
)

References bl1_is_row_storage(), bl1_srandv(), and bl1_zero_dim2().

Referenced by FLA_Random_matrix().

14 {
15  float* a_begin;
16  int inca, lda;
17  int n_iter;
18  int n_elem;
19  int j;
20 
21  // Return early if possible.
22  if ( bl1_zero_dim2( m, n ) ) return;
23 
24  // Initialize with optimal values for column-major storage.
25  inca = a_rs;
26  lda = a_cs;
27  n_iter = n;
28  n_elem = m;
29 
30  // An optimization: if A is row-major, then let's access the matrix by
31  // rows instead of by columns for increased spatial locality.
32  if ( bl1_is_row_storage( a_rs, a_cs ) )
33  {
34  bl1_swap_ints( n_iter, n_elem );
35  bl1_swap_ints( lda, inca );
36  }
37 
38  for ( j = 0; j < n_iter; j++ )
39  {
40  a_begin = a + j*lda;
41 
42  bl1_srandv( n_elem,
43  a_begin, inca );
44  }
45 }
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_srandv(int n, float *x, int incx)
Definition: bl1_randv.c:13

◆ bl1_srandmr()

void bl1_srandmr ( uplo1_t  uplo,
diag1_t  diag,
int  m,
int  n,
float *  a,
int  a_rs,
int  a_cs 
)

References bl1_is_nonunit_diag(), bl1_is_row_storage(), bl1_is_unit_diag(), bl1_is_upper(), bl1_is_zero_diag(), bl1_s0(), bl1_s1(), bl1_sinvscalv(), bl1_srands(), bl1_srandv(), bl1_ssetv(), bl1_zero_dim2(), and BLIS1_NO_CONJUGATE.

Referenced by FLA_Random_tri_matrix().

14 {
15  float* a_begin;
16  float* ajj;
17  float one;
18  float zero;
19  float ord;
20  int lda, inca;
21  int n_iter;
22  int n_elem_max;
23  int n_elem;
24  int j;
25 
26  // Return early if possible.
27  if ( bl1_zero_dim2( m, n ) ) return;
28 
29  // Initialize with optimal values for column-major storage.
30  n_iter = n;
31  n_elem_max = m;
32  lda = a_cs;
33  inca = a_rs;
34 
35  // An optimization: if A is row-major, then let's access the matrix by
36  // rows instead of by columns to increase spatial locality.
37  if ( bl1_is_row_storage( a_rs, a_cs ) )
38  {
39  bl1_swap_ints( n_iter, n_elem_max );
40  bl1_swap_ints( lda, inca );
41  bl1_toggle_uplo( uplo );
42  }
43 
44  // Initialize some scalars.
45  one = bl1_s1();
46  zero = bl1_s0();
47  ord = ( float ) bl1_max( m, n );
48 
49  if ( bl1_is_upper( uplo ) )
50  {
51  for ( j = 0; j < n_iter; j++ )
52  {
53  n_elem = bl1_min( j, n_elem_max );
54  a_begin = a + j*lda;
55 
56  // Randomize super-diagonal elements.
57  bl1_srandv( n_elem,
58  a_begin, inca );
59 
60  // Normalize super-diagonal elements by order of the matrix.
62  n_elem,
63  &ord,
64  a_begin, inca );
65 
66  // Initialize diagonal and sub-diagonal elements only if there are
67  // elements left in the column (ie: j < n_elem_max).
68  if ( j < n_elem_max )
69  {
70  ajj = a_begin + j*inca;
71 
72  // Initialize diagonal element.
73  if ( bl1_is_unit_diag( diag ) ) *ajj = one;
74  else if ( bl1_is_zero_diag( diag ) ) *ajj = zero;
75  else if ( bl1_is_nonunit_diag( diag ) )
76  {
77  // We want positive diagonal elements between 1 and 2.
78  bl1_srands( ajj );
79  bl1_sabsval2( ajj, ajj );
80  bl1_sadd3( ajj, &one, ajj );
81  }
82 
83  // Initialize sub-diagonal elements to zero.
84  bl1_ssetv( n_elem_max - j - 1,
85  &zero,
86  ajj + inca, inca );
87  }
88  }
89  }
90  else // if ( bl1_is_lower( uplo ) )
91  {
92  for ( j = 0; j < n_iter; j++ )
93  {
94  n_elem = bl1_min( j, n_elem_max );
95  a_begin = a + j*lda;
96 
97  // Initialize super-diagonal to zero.
98  bl1_ssetv( n_elem,
99  &zero,
100  a_begin, inca );
101 
102  // Initialize diagonal and sub-diagonal elements only if there are
103  // elements left in the column (ie: j < n_elem_max).
104  if ( j < n_elem_max )
105  {
106  ajj = a_begin + j*inca;
107 
108  // Initialize diagonal element.
109  if ( bl1_is_unit_diag( diag ) ) *ajj = one;
110  else if ( bl1_is_zero_diag( diag ) ) *ajj = zero;
111  else if ( bl1_is_nonunit_diag( diag ) )
112  {
113  // We want positive diagonal elements between 1 and 2.
114  bl1_srands( ajj );
115  bl1_sabsval2( ajj, ajj );
116  bl1_sadd3( ajj, &one, ajj );
117  }
118 
119  // Randomize sub-diagonal elements.
120  bl1_srandv( n_elem_max - j - 1,
121  ajj + inca, inca );
122 
123  // Normalize sub-diagonal elements by order of the matrix.
125  n_elem_max - j - 1,
126  &ord,
127  ajj + inca, inca );
128 
129  }
130  }
131  }
132 }
void bl1_srands(float *alpha)
Definition: bl1_rands.c:13
float bl1_s1(void)
Definition: bl1_constants.c:47
Definition: blis_type_defs.h:81
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_sinvscalv(conj1_t conj, int n, float *alpha, float *x, int incx)
Definition: bl1_invscalv.c:13
void bl1_ssetv(int m, float *sigma, float *x, int incx)
Definition: bl1_setv.c:26
int bl1_is_nonunit_diag(diag1_t diag)
Definition: bl1_is.c:73
int bl1_is_unit_diag(diag1_t diag)
Definition: bl1_is.c:78
int bl1_is_zero_diag(diag1_t diag)
Definition: bl1_is.c:83
void bl1_srandv(int n, float *x, int incx)
Definition: bl1_randv.c:13
float bl1_s0(void)
Definition: bl1_constants.c:111

◆ bl1_srands()

void bl1_srands ( float *  alpha)

Referenced by bl1_crands(), bl1_srandmr(), and bl1_srandv().

14 {
15  *alpha = ( float ) ( ( double ) rand() / ( ( double ) RAND_MAX / 2.0F ) ) - 1.0F;
16 }

◆ bl1_srandv()

void bl1_srandv ( int  n,
float *  x,
int  incx 
)

References bl1_srands(), and i.

Referenced by bl1_srandm(), and bl1_srandmr().

14 {
15  float* chi;
16  int i;
17 
18  for ( i = 0; i < n; ++i )
19  {
20  chi = x + i*incx;
21 
22  bl1_srands( chi );
23  }
24 }
void bl1_srands(float *alpha)
Definition: bl1_rands.c:13
int i
Definition: bl1_axmyv2.c:145

◆ bl1_sscalediag()

void bl1_sscalediag ( conj1_t  conj,
int  offset,
int  m,
int  n,
float *  sigma,
float *  a,
int  a_rs,
int  a_cs 
)

References i.

Referenced by FLA_Scale_diag(), and FLA_UDdate_UT_ops_var1().

14 {
15  float* alpha;
16  int i, j;
17 
18  i = j = 0;
19 
20  if ( offset < 0 ) i = -offset;
21  else if ( offset > 0 ) j = offset;
22 
23  while ( i < m && j < n )
24  {
25  alpha = a + i*a_rs + j*a_cs;
26 
27  *alpha *= *sigma;
28 
29  ++i;
30  ++j;
31  }
32 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_ssetdiag()

void bl1_ssetdiag ( int  offset,
int  m,
int  n,
float *  sigma,
float *  a,
int  a_rs,
int  a_cs 
)

References i.

Referenced by FLA_Set_diag(), FLA_Set_offdiag(), and FLA_Triangularize().

35 {
36  float* alpha;
37  int i, j;
38 
39  i = j = 0;
40 
41  if ( offset < 0 ) i = -offset;
42  else if ( offset > 0 ) j = offset;
43 
44  while ( i < m && j < n )
45  {
46  alpha = a + i*a_rs + j*a_cs;
47 
48  *alpha = *sigma;
49 
50  ++i;
51  ++j;
52  }
53 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_ssetm()

void bl1_ssetm ( int  m,
int  n,
float *  sigma,
float *  a,
int  a_rs,
int  a_cs 
)

References i.

Referenced by FLA_Bidiag_UT_u_step_ofs_var4(), FLA_Bidiag_UT_u_step_ops_var4(), FLA_Bidiag_UT_u_step_ops_var5(), FLA_Hess_UT_step_ofs_var4(), FLA_Hess_UT_step_ops_var4(), FLA_Hess_UT_step_ops_var5(), FLA_Set(), FLA_Tridiag_UT_l_step_ofs_var3(), and FLA_Tridiag_UT_l_step_ops_var3().

30 {
31  float* alpha;
32  int i, j;
33 
34  for ( j = 0; j < n; ++j )
35  {
36  for ( i = 0; i < m; ++i )
37  {
38  alpha = a + i*a_rs + j*a_cs;
39 
40  *alpha = *sigma;
41  }
42  }
43 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_ssetmr()

void bl1_ssetmr ( uplo1_t  uplo,
int  m,
int  n,
float *  sigma,
float *  a,
int  a_rs,
int  a_cs 
)

References bl1_is_row_storage(), bl1_is_upper(), bl1_ssetv(), and bl1_zero_dim2().

Referenced by FLA_Setr(), and FLA_Triangularize().

14 {
15  float* a_begin;
16  int lda, inca;
17  int n_iter;
18  int n_elem_max;
19  int n_elem;
20  int j;
21 
22  // Return early if possible.
23  if ( bl1_zero_dim2( m, n ) ) return;
24 
25  // Initialize with optimal values for column-major storage.
26  n_iter = n;
27  n_elem_max = m;
28  lda = a_cs;
29  inca = a_rs;
30 
31  // An optimization: if A is row-major, then let's access the matrix by
32  // rows instead of by columns to increase spatial locality.
33  if ( bl1_is_row_storage( a_rs, a_cs ) )
34  {
35  bl1_swap_ints( n_iter, n_elem_max );
36  bl1_swap_ints( lda, inca );
37  bl1_toggle_uplo( uplo );
38  }
39 
40  if ( bl1_is_upper( uplo ) )
41  {
42  for ( j = 0; j < n_iter; j++ )
43  {
44  n_elem = bl1_min( j, n_elem_max );
45  a_begin = a + j*lda;
46 
47  bl1_ssetv( n_elem,
48  sigma,
49  a_begin, inca );
50  }
51  }
52  else // if ( bl1_is_lower( uplo ) )
53  {
54  for ( j = 0; j < n_iter; j++ )
55  {
56  n_elem = bl1_max( 0, n_elem_max - j - 1 );
57  a_begin = a + j*lda + (j + 1)*inca;
58 
59  bl1_ssetv( n_elem,
60  sigma,
61  a_begin, inca );
62  }
63  }
64 }
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_ssetv(int m, float *sigma, float *x, int incx)
Definition: bl1_setv.c:26

◆ bl1_ssetv()

void bl1_ssetv ( int  m,
float *  sigma,
float *  x,
int  incx 
)

◆ bl1_sshiftdiag()

void bl1_sshiftdiag ( conj1_t  conj,
int  offset,
int  m,
int  n,
float *  sigma,
float *  a,
int  a_rs,
int  a_cs 
)

References i.

Referenced by FLA_Lyap_h_ops_var1(), FLA_Lyap_h_ops_var2(), FLA_Lyap_h_ops_var3(), FLA_Lyap_h_ops_var4(), FLA_Lyap_n_ops_var1(), FLA_Lyap_n_ops_var2(), FLA_Lyap_n_ops_var3(), FLA_Lyap_n_ops_var4(), and FLA_Shift_diag().

14 {
15  float* alpha;
16  int i, j;
17 
18  i = j = 0;
19 
20  if ( offset < 0 ) i = -offset;
21  else if ( offset > 0 ) j = offset;
22 
23  while ( i < m && j < n )
24  {
25  alpha = a + i*a_rs + j*a_cs;
26 
27  *alpha += *sigma;
28 
29  ++i;
30  ++j;
31  }
32 }
int i
Definition: bl1_axmyv2.c:145

◆ bl1_ssymmize()

void bl1_ssymmize ( conj1_t  conj,
uplo1_t  uplo,
int  m,
float *  a,
int  a_rs,
int  a_cs 
)

References bl1_is_col_storage(), bl1_is_gen_storage(), bl1_is_lower(), bl1_is_row_storage(), bl1_is_upper(), bl1_scopyv(), and bl1_zero_dim1().

Referenced by FLA_Hermitianize(), and FLA_Symmetrize().

14 {
15  float* a_src;
16  float* a_dst;
17  int rs_src, cs_src, inc_src;
18  int rs_dst, cs_dst, inc_dst;
19  int n_iter;
20  int j;
21 
22  // Return early if possible.
23  if ( bl1_zero_dim1( m ) ) return;
24 
25  // Assume A is square.
26  n_iter = m;
27 
28  // Initialize with appropriate values based on storage.
29  if ( bl1_is_col_storage( a_rs, a_cs ) && bl1_is_lower( uplo ) )
30  {
31  cs_src = 1;
32  rs_src = 0;
33  inc_src = a_cs;
34  cs_dst = a_cs;
35  rs_dst = 0;
36  inc_dst = 1;
37  }
38  else if ( bl1_is_col_storage( a_rs, a_cs ) && bl1_is_upper( uplo ) )
39  {
40  cs_src = a_cs;
41  rs_src = 0;
42  inc_src = 1;
43  cs_dst = 1;
44  rs_dst = 0;
45  inc_dst = a_cs;
46  }
47  else if ( bl1_is_row_storage( a_rs, a_cs ) && bl1_is_lower( uplo ) )
48  {
49  cs_src = 0;
50  rs_src = a_rs;
51  inc_src = 1;
52  cs_dst = 0;
53  rs_dst = 1;
54  inc_dst = a_rs;
55  }
56  else if ( bl1_is_row_storage( a_rs, a_cs ) && bl1_is_upper( uplo ) )
57  {
58  cs_src = 0;
59  rs_src = 1;
60  inc_src = a_rs;
61  cs_dst = 0;
62  rs_dst = a_rs;
63  inc_dst = 1;
64  }
65  else if ( bl1_is_gen_storage( a_rs, a_cs ) && bl1_is_lower( uplo ) )
66  {
67  // General stride with column-major tilt looks similar to column-major.
68  // General stride with row-major tilt looks similar to row-major.
69  if ( a_rs < a_cs )
70  {
71  cs_src = 1 * a_rs;
72  rs_src = 0;
73  inc_src = a_cs;
74  cs_dst = a_cs;
75  rs_dst = 0;
76  inc_dst = 1 * a_rs;
77  }
78  else // if ( a_rs > a_cs )
79  {
80  cs_src = 0;
81  rs_src = a_rs;
82  inc_src = 1 * a_cs;
83  cs_dst = 0;
84  rs_dst = 1 * a_cs;
85  inc_dst = a_rs;
86  }
87  }
88  else // if ( bl1_is_gen_storage( a_rs, a_cs ) && bl1_is_upper( uplo ) )
89  {
90  // General stride with column-major tilt looks similar to column-major.
91  // General stride with row-major tilt looks similar to row-major.
92  if ( a_rs < a_cs )
93  {
94  cs_src = a_cs;
95  rs_src = 0;
96  inc_src = 1 * a_rs;
97  cs_dst = 1 * a_rs;
98  rs_dst = 0;
99  inc_dst = a_cs;
100  }
101  else // if ( a_rs > a_cs )
102  {
103  cs_src = 0;
104  rs_src = 1 * a_cs;
105  inc_src = a_rs;
106  cs_dst = 0;
107  rs_dst = a_rs;
108  inc_dst = 1 * a_cs;
109  }
110  }
111 
112  for ( j = 0; j < n_iter; j++ )
113  {
114  a_src = a + j*cs_src + j*rs_src;
115  a_dst = a + j*cs_dst + j*rs_dst;
116 
117  bl1_scopyv( conj,
118  j,
119  a_src, inc_src,
120  a_dst, inc_dst );
121  }
122 }
int bl1_is_lower(uplo1_t uplo)
Definition: bl1_is.c:49
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
int bl1_zero_dim1(int m)
Definition: bl1_is.c:113
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
void bl1_scopyv(conj1_t conj, int m, float *x, int incx, float *y, int incy)
Definition: bl1_copyv.c:35

◆ bl1_vallocm()

void* bl1_vallocm ( unsigned int  m,
unsigned int  n,
unsigned int  elem_size 
)
21 {
22  return ( void* ) BLIS1_MALLOC( m * n * elem_size );
23 }

◆ bl1_vallocv()

void* bl1_vallocv ( unsigned int  n_elem,
unsigned int  elem_size 
)
21 {
22  return ( void* ) BLIS1_MALLOC( n_elem * elem_size );
23 }

◆ bl1_vfree()

void bl1_vfree ( void *  p)
21 {
22  free( ( void* ) p );
23 }

◆ bl1_z0()

dcomplex bl1_z0 ( void  )

References bl1_d0(), dcomplex::imag, and dcomplex::real.

Referenced by bl1_zgemm(), bl1_zgemv(), bl1_zhemm(), bl1_zhemv(), bl1_zrandmr(), bl1_zsymm(), FLA_Fused_Ahx_Ax_opz_var1(), FLA_Fused_Ahx_Axpy_Ax_opz_var1(), FLA_Fused_Gerc2_Ahx_Ax_opz_var1(), FLA_Fused_Gerc2_Ahx_Axpy_Ax_opz_var1(), FLA_Fused_Her2_Ax_l_opz_var1(), FLA_Fused_Uhu_Yhu_Zhu_opz_var1(), FLA_Fused_UYx_ZVx_opz_var1(), FLA_QR_UT_form_Q_opz_var1(), and FLA_Tridiag_UT_shift_U_l_opz().

134 {
135  dcomplex x;
136  x.real = bl1_d0();
137  x.imag = bl1_d0();
138  return x;
139 }
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
double bl1_d0(void)
Definition: bl1_constants.c:118
Definition: blis_type_defs.h:137

◆ bl1_z1()

dcomplex bl1_z1 ( void  )

References bl1_d0(), bl1_d1(), dcomplex::imag, and dcomplex::real.

Referenced by bl1_zgemm(), bl1_zgemv(), bl1_zhemm(), bl1_zhemv(), bl1_zher2k(), bl1_zherk(), bl1_zrandmr(), bl1_zsymm(), bl1_ztrmmsx(), bl1_ztrsmsx(), FLA_Bsvd_ext_opd_var1(), FLA_Bsvd_ext_opz_var1(), FLA_Bsvd_v_opd_var1(), FLA_Bsvd_v_opd_var2(), FLA_Bsvd_v_opz_var1(), FLA_Bsvd_v_opz_var2(), FLA_QR_UT_form_Q_opz_var1(), FLA_Tevd_n_opz_var1(), FLA_Tevd_v_opd_var1(), FLA_Tevd_v_opd_var2(), FLA_Tevd_v_opz_var1(), FLA_Tevd_v_opz_var2(), and FLA_Tridiag_UT_shift_U_l_opz().

70 {
71  dcomplex x;
72  x.real = bl1_d1();
73  x.imag = bl1_d0();
74  return x;
75 }
double bl1_d1(void)
Definition: bl1_constants.c:54
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
double bl1_d0(void)
Definition: bl1_constants.c:118
Definition: blis_type_defs.h:137

◆ bl1_z1h()

dcomplex bl1_z1h ( void  )

References bl1_d0(), bl1_d1h(), dcomplex::imag, and dcomplex::real.

102 {
103  dcomplex x;
104  x.real = bl1_d1h();
105  x.imag = bl1_d0();
106  return x;
107 }
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
double bl1_d1h(void)
Definition: bl1_constants.c:86
double bl1_d0(void)
Definition: bl1_constants.c:118
Definition: blis_type_defs.h:137

◆ bl1_z2()

dcomplex bl1_z2 ( void  )

References bl1_d0(), bl1_d2(), dcomplex::imag, and dcomplex::real.

38 {
39  dcomplex x;
40  x.real = bl1_d2();
41  x.imag = bl1_d0();
42  return x;
43 }
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
double bl1_d2(void)
Definition: bl1_constants.c:22
double bl1_d0(void)
Definition: bl1_constants.c:118
Definition: blis_type_defs.h:137

◆ bl1_zallocm()

dcomplex* bl1_zallocm ( unsigned int  m,
unsigned int  n 
)

Referenced by bl1_zcreate_contigm(), bl1_zcreate_contigmr(), bl1_zcreate_contigmt(), bl1_zgemm(), bl1_zhemm(), bl1_zher2k(), bl1_zherk(), bl1_zsymm(), bl1_zsyr2k(), bl1_ztrmm(), bl1_ztrmmsx(), bl1_ztrsm(), and bl1_ztrsmsx().

46 {
47  return ( dcomplex* ) BLIS1_MALLOC( m * n * sizeof( dcomplex ) );
48 }
Definition: blis_type_defs.h:137

◆ bl1_zallocv()

dcomplex* bl1_zallocv ( unsigned int  n_elem)

Referenced by bl1_zaxpymt(), bl1_zaxpysmt(), bl1_zaxpyv(), bl1_zgemv(), bl1_zger(), bl1_zhemv(), bl1_zher(), bl1_zher2(), bl1_zsymv_blas(), bl1_zsyr2_blas(), bl1_zsyr_blas(), bl1_ztrmv(), bl1_ztrmvsx(), bl1_ztrsv(), and bl1_ztrsvsx().

46 {
47  return ( dcomplex* ) BLIS1_MALLOC( n_elem * sizeof( dcomplex ) );
48 }
Definition: blis_type_defs.h:137

◆ bl1_zapdiagmv()

void bl1_zapdiagmv ( side1_t  side,
conj1_t  conj,
int  m,
int  n,
dcomplex x,
int  incx,
dcomplex a,
int  a_rs,
int  a_cs 
)

References bl1_is_left(), bl1_is_row_storage(), bl1_zero_dim2(), bl1_zewscalv(), and bl1_zscalv().

Referenced by FLA_Apply_diag_matrix().

289 {
290  dcomplex* chi;
291  dcomplex* a_begin;
292  int inca, lda;
293  int n_iter;
294  int n_elem;
295  int j;
296 
297  // Return early if possible.
298  if ( bl1_zero_dim2( m, n ) ) return;
299 
300  // Initialize with optimal values for column-major storage.
301  inca = a_rs;
302  lda = a_cs;
303  n_iter = n;
304  n_elem = m;
305 
306  // An optimization: if A is row-major, then we can proceed as if the
307  // operation were transposed (applying the diagonal values in x from the
308  // opposite side) for increased spatial locality.
309  if ( bl1_is_row_storage( a_rs, a_cs ) )
310  {
311  bl1_swap_ints( n_iter, n_elem );
312  bl1_swap_ints( lda, inca );
313  bl1_toggle_side( side );
314  }
315 
316  if ( bl1_is_left( side ) )
317  {
318  for ( j = 0; j < n_iter; j++ )
319  {
320  a_begin = a + j*lda;
321 
322  bl1_zewscalv( conj,
323  n_elem,
324  x, incx,
325  a_begin, inca );
326  }
327  }
328  else
329  {
330  for ( j = 0; j < n_iter; j++ )
331  {
332  a_begin = a + j*lda;
333  chi = x + j*incx;
334 
335  bl1_zscalv( conj,
336  n_elem,
337  chi,
338  a_begin, inca );
339  }
340  }
341 }
void bl1_zscalv(conj1_t conj, int n, dcomplex *alpha, dcomplex *x, int incx)
Definition: bl1_scalv.c:72
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_zewscalv(conj1_t conj, int n, dcomplex *x, int incx, dcomplex *y, int incy)
Definition: bl1_ewscalv.c:103
Definition: blis_type_defs.h:137

◆ bl1_zcreate_contigm()

void bl1_zcreate_contigm ( int  m,
int  n,
dcomplex a_save,
int  a_rs_save,
int  a_cs_save,
dcomplex **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_is_gen_storage(), bl1_set_contig_strides(), bl1_zallocm(), bl1_zcopymt(), and BLIS1_NO_TRANSPOSE.

Referenced by bl1_zgemm(), bl1_zgemv(), bl1_zger(), bl1_zhemm(), bl1_zsymm(), bl1_ztrmm(), bl1_ztrmmsx(), bl1_ztrsm(), and bl1_ztrsmsx().

116 {
117  int m_contig, n_contig;
118 
119  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
120  {
121  // Initialize dimensions assuming no transposition needed during copy.
122  m_contig = m;
123  n_contig = n;
124 
125 /*
126  // Transpose the dimensions of the contiguous matrix, if requested.
127  if ( bl1_does_trans( trans_copy ) )
128  {
129  m_contig = n;
130  n_contig = m;
131  }
132 */
133 
134  // Allocate temporary contiguous storage for the matrix.
135  *a = bl1_zallocm( m_contig, n_contig );
136 
137  // Set the row and column strides for the temporary matrix.
138  bl1_set_contig_strides( m_contig, n_contig, a_rs, a_cs );
139 
140  // Initialize the contiguous matrix with the contents of the original.
142  m_contig,
143  n_contig,
144  a_save, a_rs_save, a_cs_save,
145  *a, *a_rs, *a_cs );
146  }
147 }
dcomplex * bl1_zallocm(unsigned int m, unsigned int n)
Definition: bl1_allocm.c:45
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
Definition: blis_type_defs.h:54
void bl1_zcopymt(trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:286
void bl1_set_contig_strides(int m, int n, int *rs, int *cs)
Definition: bl1_set_contig_strides.c:13

◆ bl1_zcreate_contigmr()

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 
)

References bl1_is_gen_storage(), bl1_set_contig_strides(), bl1_zallocm(), and bl1_zcopymr().

Referenced by bl1_zcreate_contigmsr(), bl1_zhemm(), bl1_zhemv(), bl1_zher(), bl1_zher2(), bl1_zher2k(), bl1_zherk(), bl1_zsymm(), bl1_zsymv(), bl1_zsyr(), bl1_zsyr2(), bl1_zsyr2k(), bl1_zsyrk(), bl1_ztrmm(), bl1_ztrmmsx(), bl1_ztrmv(), bl1_ztrmvsx(), bl1_ztrsm(), bl1_ztrsmsx(), bl1_ztrsv(), and bl1_ztrsvsx().

110 {
111  int m_contig, n_contig;
112 
113  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
114  {
115  // Initialize dimensions assuming no transposition needed during copy.
116  m_contig = m;
117  n_contig = n;
118 /*
119  // Transpose the dimensions of the contiguous matrix, if requested.
120  if ( bl1_does_trans( trans_copy ) )
121  {
122  m_contig = n;
123  n_contig = m;
124  }
125 */
126  // Allocate temporary contiguous storage for the matrix.
127  *a = bl1_zallocm( m_contig, n_contig );
128 
129  // Set the row and column strides for the temporary matrix.
130  bl1_set_contig_strides( m_contig, n_contig, a_rs, a_cs );
131 
132  // Initialize the contiguous matrix with the contents of the original.
133  bl1_zcopymr( uplo,
134  m_contig,
135  n_contig,
136  a_save, a_rs_save, a_cs_save,
137  *a, *a_rs, *a_cs );
138  }
139 }
dcomplex * bl1_zallocm(unsigned int m, unsigned int n)
Definition: bl1_allocm.c:45
void bl1_zcopymr(uplo1_t uplo, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:202
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
void bl1_set_contig_strides(int m, int n, int *rs, int *cs)
Definition: bl1_set_contig_strides.c:13

◆ bl1_zcreate_contigmsr()

void bl1_zcreate_contigmsr ( side1_t  side,
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 
)

References bl1_is_left(), and bl1_zcreate_contigmr().

62 {
63  int dim_a;
64 
65  // Choose the dimension of the matrix based on the side parameter.
66  if ( bl1_is_left( side ) ) dim_a = m;
67  else dim_a = n;
68 
69  // Call the simple version with chosen dimensions.
71  dim_a,
72  dim_a,
73  a_save, a_rs_save, a_cs_save,
74  a, a_rs, a_cs );
75 }
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
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61

◆ bl1_zcreate_contigmt()

void bl1_zcreate_contigmt ( trans1_t  trans_dims,
int  m,
int  n,
dcomplex a_save,
int  a_rs_save,
int  a_cs_save,
dcomplex **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_does_trans(), bl1_is_gen_storage(), bl1_set_contig_strides(), bl1_zallocm(), bl1_zcopymt(), and BLIS1_NO_TRANSPOSE.

Referenced by bl1_zgemm(), bl1_zher2k(), bl1_zherk(), bl1_zsyr2k(), and bl1_zsyrk().

128 {
129  int m_contig, n_contig;
130 
131  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
132  {
133  // Transpose the dimensions if requested.
134  if ( bl1_does_trans( trans_dims ) )
135  bl1_swap_ints( m, n );
136 
137  // Initialize dimensions assuming no transposition needed during copy.
138  m_contig = m;
139  n_contig = n;
140 
141 /*
142  // Transpose the dimensions of the contiguous matrix, if requested.
143  if ( bl1_does_trans( trans_copy ) )
144  {
145  m_contig = n;
146  n_contig = m;
147  }
148 */
149 
150  // Allocate temporary contiguous storage for the matrix.
151  *a = bl1_zallocm( m_contig, n_contig );
152 
153  // Set the row and column strides for the temporary matrix.
154  bl1_set_contig_strides( m_contig, n_contig, a_rs, a_cs );
155 
156  // Initialize the contiguous matrix with the contents of the original.
158  m_contig,
159  n_contig,
160  a_save, a_rs_save, a_cs_save,
161  *a, *a_rs, *a_cs );
162  }
163 }
dcomplex * bl1_zallocm(unsigned int m, unsigned int n)
Definition: bl1_allocm.c:45
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
Definition: blis_type_defs.h:54
void bl1_zcopymt(trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:286
void bl1_set_contig_strides(int m, int n, int *rs, int *cs)
Definition: bl1_set_contig_strides.c:13
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13

◆ bl1_zdapdiagmv()

void bl1_zdapdiagmv ( side1_t  side,
conj1_t  conj,
int  m,
int  n,
double *  x,
int  incx,
dcomplex a,
int  a_rs,
int  a_cs 
)

References bl1_is_left(), bl1_is_row_storage(), bl1_zdewscalv(), bl1_zdscalv(), and bl1_zero_dim2().

Referenced by FLA_Apply_diag_matrix().

234 {
235  double* chi;
236  dcomplex* a_begin;
237  int inca, lda;
238  int n_iter;
239  int n_elem;
240  int j;
241 
242  // Return early if possible.
243  if ( bl1_zero_dim2( m, n ) ) return;
244 
245  // Initialize with optimal values for column-major storage.
246  inca = a_rs;
247  lda = a_cs;
248  n_iter = n;
249  n_elem = m;
250 
251  // An optimization: if A is row-major, then we can proceed as if the
252  // operation were transposed (applying the diagonal values in x from the
253  // opposite side) for increased spatial locality.
254  if ( bl1_is_row_storage( a_rs, a_cs ) )
255  {
256  bl1_swap_ints( n_iter, n_elem );
257  bl1_swap_ints( lda, inca );
258  bl1_toggle_side( side );
259  }
260 
261  if ( bl1_is_left( side ) )
262  {
263  for ( j = 0; j < n_iter; j++ )
264  {
265  a_begin = a + j*lda;
266 
267  bl1_zdewscalv( conj,
268  n_elem,
269  x, incx,
270  a_begin, inca );
271  }
272  }
273  else
274  {
275  for ( j = 0; j < n_iter; j++ )
276  {
277  a_begin = a + j*lda;
278  chi = x + j*incx;
279 
280  bl1_zdscalv( conj,
281  n_elem,
282  chi,
283  a_begin, inca );
284  }
285  }
286 }
void bl1_zdscalv(conj1_t conj, int n, double *alpha, dcomplex *x, int incx)
Definition: bl1_scalv.c:61
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61
void bl1_zdewscalv(conj1_t conj, int n, double *x, int incx, dcomplex *y, int incy)
Definition: bl1_ewscalv.c:88
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
Definition: blis_type_defs.h:137

◆ bl1_zdewinvscalmt()

void bl1_zdewinvscalmt ( trans1_t  trans,
int  m,
int  n,
double *  a,
int  a_rs,
int  a_cs,
dcomplex b,
int  b_rs,
int  b_cs 
)

References bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zdewinvscalv(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

302 {
303  double* a_begin;
304  dcomplex* b_begin;
305  int lda, inca;
306  int ldb, incb;
307  int n_iter;
308  int n_elem;
309  int j;
310  conj1_t conj;
311 
312  // Return early if possible.
313  if ( bl1_zero_dim2( m, n ) ) return;
314 
315  // Handle cases where A and B are vectors to ensure that the underlying ewinvscal
316  // gets invoked only once.
317  if ( bl1_is_vector( m, n ) )
318  {
319  // Initialize with values appropriate for vectors.
320  n_iter = 1;
321  n_elem = bl1_vector_dim( m, n );
322  lda = 1; // multiplied by zero when n_iter == 1; not needed.
323  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
324  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
325  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
326  }
327  else // matrix case
328  {
329  // Initialize with optimal values for column-major storage.
330  n_iter = n;
331  n_elem = m;
332  lda = a_cs;
333  inca = a_rs;
334  ldb = b_cs;
335  incb = b_rs;
336 
337  // Handle the transposition of A.
338  if ( bl1_does_trans( trans ) )
339  {
340  bl1_swap_ints( lda, inca );
341  }
342 
343  // An optimization: if B is row-major and if A is effectively row-major
344  // after a possible transposition, then let's access the matrices by rows
345  // instead of by columns for increased spatial locality.
346  if ( bl1_is_row_storage( b_rs, b_cs ) )
347  {
348  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
349  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
350  {
351  bl1_swap_ints( n_iter, n_elem );
352  bl1_swap_ints( lda, inca );
353  bl1_swap_ints( ldb, incb );
354  }
355  }
356  }
357 
358  // Extract conj component from trans parameter.
359  conj = bl1_proj_trans1_to_conj( trans );
360 
361  for ( j = 0; j < n_iter; j++ )
362  {
363  a_begin = a + j*lda;
364  b_begin = b + j*ldb;
365 
366  bl1_zdewinvscalv( conj,
367  n_elem,
368  a_begin, inca,
369  b_begin, incb );
370  }
371 }
void bl1_zdewinvscalv(conj1_t conj, int n, double *x, int incx, dcomplex *y, int incy)
Definition: bl1_ewinvscalv.c:88
int bl1_vector_dim(int m, int n)
Definition: bl1_vector.c:13
conj1_t
Definition: blis_type_defs.h:79
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_does_notrans(trans1_t trans)
Definition: bl1_does.c:19
int bl1_vector_inc(trans1_t trans, int m, int n, int rs, int cs)
Definition: bl1_vector.c:19
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
Definition: blis_type_defs.h:54
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition: bl1_proj.c:13
int bl1_is_vector(int m, int n)
Definition: bl1_is.c:106
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13
Definition: blis_type_defs.h:137

◆ bl1_zdewinvscalv()

void bl1_zdewinvscalv ( conj1_t  conj,
int  n,
double *  x,
int  incx,
dcomplex y,
int  incy 
)

References i.

Referenced by bl1_zdewinvscalmt().

89 {
90  double* chi;
91  dcomplex* psi;
92  int i;
93 
94  for ( i = 0; i < n; ++i )
95  {
96  chi = x + i*incx;
97  psi = y + i*incy;
98 
99  bl1_zdinvscals( chi, psi );
100  }
101 }
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137

◆ bl1_zdewscalmt()

void bl1_zdewscalmt ( trans1_t  trans,
int  m,
int  n,
double *  a,
int  a_rs,
int  a_cs,
dcomplex b,
int  b_rs,
int  b_cs 
)

References bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zdewscalv(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

302 {
303  double* a_begin;
304  dcomplex* b_begin;
305  int lda, inca;
306  int ldb, incb;
307  int n_iter;
308  int n_elem;
309  int j;
310  conj1_t conj;
311 
312  // Return early if possible.
313  if ( bl1_zero_dim2( m, n ) ) return;
314 
315  // Handle cases where A and B are vectors to ensure that the underlying ewscal
316  // gets invoked only once.
317  if ( bl1_is_vector( m, n ) )
318  {
319  // Initialize with values appropriate for vectors.
320  n_iter = 1;
321  n_elem = bl1_vector_dim( m, n );
322  lda = 1; // multiplied by zero when n_iter == 1; not needed.
323  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
324  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
325  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
326  }
327  else // matrix case
328  {
329  // Initialize with optimal values for column-major storage.
330  n_iter = n;
331  n_elem = m;
332  lda = a_cs;
333  inca = a_rs;
334  ldb = b_cs;
335  incb = b_rs;
336 
337  // Handle the transposition of A.
338  if ( bl1_does_trans( trans ) )
339  {
340  bl1_swap_ints( lda, inca );
341  }
342 
343  // An optimization: if B is row-major and if A is effectively row-major
344  // after a possible transposition, then let's access the matrices by rows
345  // instead of by columns for increased spatial locality.
346  if ( bl1_is_row_storage( b_rs, b_cs ) )
347  {
348  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
349  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
350  {
351  bl1_swap_ints( n_iter, n_elem );
352  bl1_swap_ints( lda, inca );
353  bl1_swap_ints( ldb, incb );
354  }
355  }
356  }
357 
358  // Extract conj component from trans parameter.
359  conj = bl1_proj_trans1_to_conj( trans );
360 
361  for ( j = 0; j < n_iter; j++ )
362  {
363  a_begin = a + j*lda;
364  b_begin = b + j*ldb;
365 
366  bl1_zdewscalv( conj,
367  n_elem,
368  a_begin, inca,
369  b_begin, incb );
370  }
371 }
int bl1_vector_dim(int m, int n)
Definition: bl1_vector.c:13
conj1_t
Definition: blis_type_defs.h:79
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_does_notrans(trans1_t trans)
Definition: bl1_does.c:19
void bl1_zdewscalv(conj1_t conj, int n, double *x, int incx, dcomplex *y, int incy)
Definition: bl1_ewscalv.c:88
int bl1_vector_inc(trans1_t trans, int m, int n, int rs, int cs)
Definition: bl1_vector.c:19
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
Definition: blis_type_defs.h:54
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition: bl1_proj.c:13
int bl1_is_vector(int m, int n)
Definition: bl1_is.c:106
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13
Definition: blis_type_defs.h:137

◆ bl1_zdewscalv()

void bl1_zdewscalv ( conj1_t  conj,
int  n,
double *  x,
int  incx,
dcomplex y,
int  incy 
)

References i.

Referenced by bl1_zdapdiagmv(), and bl1_zdewscalmt().

89 {
90  double* chi;
91  dcomplex* psi;
92  int i;
93 
94  for ( i = 0; i < n; ++i )
95  {
96  chi = x + i*incx;
97  psi = y + i*incy;
98 
99  bl1_zdscals( chi, psi );
100  }
101 }
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137

◆ bl1_zdscalediag()

void bl1_zdscalediag ( conj1_t  conj,
int  offset,
int  m,
int  n,
double *  sigma,
dcomplex a,
int  a_rs,
int  a_cs 
)

References i, dcomplex::imag, and dcomplex::real.

Referenced by FLA_Scale_diag().

78 {
79  dcomplex* alpha;
80  int i, j;
81 
82  i = j = 0;
83 
84  if ( offset < 0 ) i = -offset;
85  else if ( offset > 0 ) j = offset;
86 
87  while ( i < m && j < n )
88  {
89  alpha = a + i*a_rs + j*a_cs;
90 
91  alpha->real *= *sigma;
92  alpha->imag *= *sigma;
93 
94  ++i;
95  ++j;
96  }
97 }
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137

◆ bl1_zdshiftdiag()

void bl1_zdshiftdiag ( conj1_t  conj,
int  offset,
int  m,
int  n,
double *  sigma,
dcomplex a,
int  a_rs,
int  a_cs 
)

References i, and dcomplex::real.

Referenced by FLA_Shift_diag().

77 {
78  dcomplex* alpha;
79  int i, j;
80 
81  i = j = 0;
82 
83  if ( offset < 0 ) i = -offset;
84  else if ( offset > 0 ) j = offset;
85 
86  while ( i < m && j < n )
87  {
88  alpha = a + i*a_rs + j*a_cs;
89 
90  alpha->real += *sigma;
91 
92  ++i;
93  ++j;
94  }
95 }
double real
Definition: blis_type_defs.h:139
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137

◆ bl1_zewinvscalmt()

void bl1_zewinvscalmt ( trans1_t  trans,
int  m,
int  n,
dcomplex a,
int  a_rs,
int  a_cs,
dcomplex b,
int  b_rs,
int  b_cs 
)

References bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), bl1_zewinvscalv(), and BLIS1_NO_TRANSPOSE.

Referenced by FLA_Inv_scal_elemwise().

374 {
375  dcomplex* a_begin;
376  dcomplex* b_begin;
377  int lda, inca;
378  int ldb, incb;
379  int n_iter;
380  int n_elem;
381  int j;
382  conj1_t conj;
383 
384  // Return early if possible.
385  if ( bl1_zero_dim2( m, n ) ) return;
386 
387  // Handle cases where A and B are vectors to ensure that the underlying ewinvscal
388  // gets invoked only once.
389  if ( bl1_is_vector( m, n ) )
390  {
391  // Initialize with values appropriate for vectors.
392  n_iter = 1;
393  n_elem = bl1_vector_dim( m, n );
394  lda = 1; // multiplied by zero when n_iter == 1; not needed.
395  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
396  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
397  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
398  }
399  else // matrix case
400  {
401  // Initialize with optimal values for column-major storage.
402  n_iter = n;
403  n_elem = m;
404  lda = a_cs;
405  inca = a_rs;
406  ldb = b_cs;
407  incb = b_rs;
408 
409  // Handle the transposition of A.
410  if ( bl1_does_trans( trans ) )
411  {
412  bl1_swap_ints( lda, inca );
413  }
414 
415  // An optimization: if B is row-major and if A is effectively row-major
416  // after a possible transposition, then let's access the matrices by rows
417  // instead of by columns for increased spatial locality.
418  if ( bl1_is_row_storage( b_rs, b_cs ) )
419  {
420  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
421  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
422  {
423  bl1_swap_ints( n_iter, n_elem );
424  bl1_swap_ints( lda, inca );
425  bl1_swap_ints( ldb, incb );
426  }
427  }
428  }
429 
430  // Extract conj component from trans parameter.
431  conj = bl1_proj_trans1_to_conj( trans );
432 
433  for ( j = 0; j < n_iter; j++ )
434  {
435  a_begin = a + j*lda;
436  b_begin = b + j*ldb;
437 
438  bl1_zewinvscalv( conj,
439  n_elem,
440  a_begin, inca,
441  b_begin, incb );
442  }
443 }
int bl1_vector_dim(int m, int n)
Definition: bl1_vector.c:13
conj1_t
Definition: blis_type_defs.h:79
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_does_notrans(trans1_t trans)
Definition: bl1_does.c:19
int bl1_vector_inc(trans1_t trans, int m, int n, int rs, int cs)
Definition: bl1_vector.c:19
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
Definition: blis_type_defs.h:54
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition: bl1_proj.c:13
void bl1_zewinvscalv(conj1_t conj, int n, dcomplex *x, int incx, dcomplex *y, int incy)
Definition: bl1_ewinvscalv.c:103
int bl1_is_vector(int m, int n)
Definition: bl1_is.c:106
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13
Definition: blis_type_defs.h:137

◆ bl1_zewinvscalv()

void bl1_zewinvscalv ( conj1_t  conj,
int  n,
dcomplex x,
int  incx,
dcomplex y,
int  incy 
)

References bl1_is_conj(), and i.

Referenced by bl1_zewinvscalmt().

104 {
105  dcomplex* chi;
106  dcomplex* psi;
107  dcomplex conjchi;
108  int i;
109 
110  if ( bl1_is_conj( conj ) )
111  {
112  for ( i = 0; i < n; ++i )
113  {
114  chi = x + i*incx;
115  psi = y + i*incy;
116 
117  bl1_zcopyconj( chi, &conjchi );
118  bl1_zinvscals( &conjchi, psi );
119  }
120  }
121  else
122  {
123  for ( i = 0; i < n; ++i )
124  {
125  chi = x + i*incx;
126  psi = y + i*incy;
127 
128  bl1_zinvscals( chi, psi );
129  }
130  }
131 }
int bl1_is_conj(conj1_t conj)
Definition: bl1_is.c:42
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137

◆ bl1_zewscalmt()

void bl1_zewscalmt ( trans1_t  trans,
int  m,
int  n,
dcomplex a,
int  a_rs,
int  a_cs,
dcomplex b,
int  b_rs,
int  b_cs 
)

References bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), bl1_zewscalv(), and BLIS1_NO_TRANSPOSE.

Referenced by FLA_Scal_elemwise().

374 {
375  dcomplex* a_begin;
376  dcomplex* b_begin;
377  int lda, inca;
378  int ldb, incb;
379  int n_iter;
380  int n_elem;
381  int j;
382  conj1_t conj;
383 
384  // Return early if possible.
385  if ( bl1_zero_dim2( m, n ) ) return;
386 
387  // Handle cases where A and B are vectors to ensure that the underlying ewscal
388  // gets invoked only once.
389  if ( bl1_is_vector( m, n ) )
390  {
391  // Initialize with values appropriate for vectors.
392  n_iter = 1;
393  n_elem = bl1_vector_dim( m, n );
394  lda = 1; // multiplied by zero when n_iter == 1; not needed.
395  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
396  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
397  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
398  }
399  else // matrix case
400  {
401  // Initialize with optimal values for column-major storage.
402  n_iter = n;
403  n_elem = m;
404  lda = a_cs;
405  inca = a_rs;
406  ldb = b_cs;
407  incb = b_rs;
408 
409  // Handle the transposition of A.
410  if ( bl1_does_trans( trans ) )
411  {
412  bl1_swap_ints( lda, inca );
413  }
414 
415  // An optimization: if B is row-major and if A is effectively row-major
416  // after a possible transposition, then let's access the matrices by rows
417  // instead of by columns for increased spatial locality.
418  if ( bl1_is_row_storage( b_rs, b_cs ) )
419  {
420  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
421  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
422  {
423  bl1_swap_ints( n_iter, n_elem );
424  bl1_swap_ints( lda, inca );
425  bl1_swap_ints( ldb, incb );
426  }
427  }
428  }
429 
430  // Extract conj component from trans parameter.
431  conj = bl1_proj_trans1_to_conj( trans );
432 
433  for ( j = 0; j < n_iter; j++ )
434  {
435  a_begin = a + j*lda;
436  b_begin = b + j*ldb;
437 
438  bl1_zewscalv( conj,
439  n_elem,
440  a_begin, inca,
441  b_begin, incb );
442  }
443 }
int bl1_vector_dim(int m, int n)
Definition: bl1_vector.c:13
conj1_t
Definition: blis_type_defs.h:79
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_does_notrans(trans1_t trans)
Definition: bl1_does.c:19
int bl1_vector_inc(trans1_t trans, int m, int n, int rs, int cs)
Definition: bl1_vector.c:19
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
void bl1_zewscalv(conj1_t conj, int n, dcomplex *x, int incx, dcomplex *y, int incy)
Definition: bl1_ewscalv.c:103
Definition: blis_type_defs.h:54
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition: bl1_proj.c:13
int bl1_is_vector(int m, int n)
Definition: bl1_is.c:106
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13
Definition: blis_type_defs.h:137

◆ bl1_zewscalv()

void bl1_zewscalv ( conj1_t  conj,
int  n,
dcomplex x,
int  incx,
dcomplex y,
int  incy 
)

References bl1_is_conj(), bl1_zscals(), and i.

Referenced by bl1_zapdiagmv(), and bl1_zewscalmt().

104 {
105  dcomplex* chi;
106  dcomplex* psi;
107  dcomplex conjchi;
108  int i;
109 
110  if ( bl1_is_conj( conj ) )
111  {
112  for ( i = 0; i < n; ++i )
113  {
114  chi = x + i*incx;
115  psi = y + i*incy;
116 
117  bl1_zcopyconj( chi, &conjchi );
118  bl1_zscals( &conjchi, psi );
119  }
120  }
121  else
122  {
123  for ( i = 0; i < n; ++i )
124  {
125  chi = x + i*incx;
126  psi = y + i*incy;
127 
128  bl1_zscals( chi, psi );
129  }
130  }
131 }
int bl1_is_conj(conj1_t conj)
Definition: bl1_is.c:42
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137
bl1_zscals(beta, rho_yz)

◆ bl1_zfree()

void bl1_zfree ( dcomplex p)

◆ bl1_zfree_contigm()

void bl1_zfree_contigm ( dcomplex a_save,
int  a_rs_save,
int  a_cs_save,
dcomplex **  a,
int *  a_rs,
int *  a_cs 
)

References bl1_is_gen_storage(), and bl1_zfree().

Referenced by bl1_zgemm(), bl1_zgemv(), bl1_zhemm(), bl1_zhemv(), bl1_zher2k(), bl1_zherk(), bl1_zsymm(), bl1_zsymv(), bl1_zsyr2k(), bl1_zsyrk(), bl1_ztrmm(), bl1_ztrmmsx(), bl1_ztrmv(), bl1_ztrmvsx(), bl1_ztrsm(), bl1_ztrsmsx(), bl1_ztrsv(), and bl1_ztrsvsx().

62 {
63  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
64  {
65  // Free the temporary contiguous storage for the matrix.
66  bl1_zfree( *a );
67 
68  // Restore the original matrix address.
69  *a = a_save;
70 
71  // Restore the original row and column strides.
72  *a_rs = a_rs_save;
73  *a_cs = a_cs_save;
74  }
75 }
void bl1_zfree(dcomplex *p)
Definition: bl1_free.c:45
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100

◆ bl1_zfree_saved_contigm()

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 
)

References bl1_is_gen_storage(), bl1_zcopymt(), bl1_zfree(), and BLIS1_NO_TRANSPOSE.

Referenced by bl1_zgemm(), bl1_zger(), bl1_zhemm(), bl1_zher(), bl1_zher2(), bl1_zsymm(), bl1_zsyr(), bl1_zsyr2(), bl1_ztrmm(), bl1_ztrmmsx(), bl1_ztrsm(), and bl1_ztrsmsx().

83 {
84  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
85  {
86  // Copy the contents of the temporary matrix back to the original.
88  m,
89  n,
90  *a, *a_rs, *a_cs,
91  a_save, a_rs_save, a_cs_save );
92 
93  // Free the temporary contiguous storage for the matrix.
94  bl1_zfree( *a );
95 
96  // Restore the original matrix address.
97  *a = a_save;
98 
99  // Restore the original row and column strides.
100  *a_rs = a_rs_save;
101  *a_cs = a_cs_save;
102  }
103 }
void bl1_zfree(dcomplex *p)
Definition: bl1_free.c:45
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
Definition: blis_type_defs.h:54
void bl1_zcopymt(trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:286

◆ bl1_zfree_saved_contigmr()

void bl1_zfree_saved_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 
)

References bl1_is_gen_storage(), bl1_zcopymr(), and bl1_zfree().

Referenced by bl1_zher2k(), bl1_zherk(), bl1_zsyr2k(), and bl1_zsyrk().

83 {
84  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
85  {
86  // Copy the contents of the temporary matrix back to the original.
87  bl1_zcopymr( uplo,
88  m,
89  n,
90  *a, *a_rs, *a_cs,
91  a_save, a_rs_save, a_cs_save );
92 
93  // Free the temporary contiguous storage for the matrix.
94  bl1_zfree( *a );
95 
96  // Restore the original matrix address.
97  *a = a_save;
98 
99  // Restore the original row and column strides.
100  *a_rs = a_rs_save;
101  *a_cs = a_cs_save;
102  }
103 }
void bl1_zfree(dcomplex *p)
Definition: bl1_free.c:45
void bl1_zcopymr(uplo1_t uplo, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:202
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100

◆ bl1_zfree_saved_contigmsr()

void bl1_zfree_saved_contigmsr ( side1_t  side,
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 
)

References bl1_is_gen_storage(), bl1_is_left(), bl1_zcopymr(), and bl1_zfree().

101 {
102  int dim_a;
103 
104  // Choose the dimension of the matrix based on the side parameter.
105  if ( bl1_is_left( side ) ) dim_a = m;
106  else dim_a = n;
107 
108  if ( bl1_is_gen_storage( a_rs_save, a_cs_save ) )
109  {
110  // Copy the contents of the temporary matrix back to the original.
111  bl1_zcopymr( uplo,
112  dim_a,
113  dim_a,
114  *a, *a_rs, *a_cs,
115  a_save, a_rs_save, a_cs_save );
116 
117  // Free the temporary contiguous storage for the matrix.
118  bl1_zfree( *a );
119 
120  // Restore the original matrix address.
121  *a = a_save;
122 
123  // Restore the original row and column strides.
124  *a_rs = a_rs_save;
125  *a_cs = a_cs_save;
126  }
127 }
int bl1_is_left(side1_t side)
Definition: bl1_is.c:61
void bl1_zfree(dcomplex *p)
Definition: bl1_free.c:45
void bl1_zcopymr(uplo1_t uplo, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:202
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100

◆ bl1_zident()

void bl1_zident ( int  m,
dcomplex a,
int  a_rs,
int  a_cs 
)

References i, dcomplex::imag, and dcomplex::real.

Referenced by FLA_UDdate_UT_opz_var1().

72 {
73  dcomplex* alpha;
74  int i, j;
75 
76  for ( j = 0; j < m; ++j )
77  {
78  for ( i = 0; i < m; ++i )
79  {
80  alpha = a + i*a_rs + j*a_cs;
81 
82  alpha->real = 0.0;
83  alpha->imag = 0.0;
84 
85  if ( i == j )
86  alpha->real = 1.0;
87  }
88  }
89 }
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137

◆ bl1_zinvert2s()

void bl1_zinvert2s ( conj1_t  conj,
dcomplex alpha,
dcomplex beta 
)

References bl1_is_conj(), dcomplex::imag, dcomplex::real, and temp.

Referenced by bl1_zinvscalm(), and bl1_zinvscalv().

45 {
46  double temp;
47  double s, xr_s, xi_s;
48 
49  s = bl1_fmaxabs( alpha->real, alpha->imag ); \
50  xr_s = alpha->real / s;
51  xi_s = alpha->imag / s;
52  temp = xr_s * alpha->real + xi_s * alpha->imag;
53 
54  beta->real = xr_s / temp;
55  beta->imag = -xi_s / temp;
56 
57  if ( bl1_is_conj( conj ) )
58  bl1_zconjs( beta );
59 }
int bl1_is_conj(conj1_t conj)
Definition: bl1_is.c:42
double imag
Definition: blis_type_defs.h:139
dcomplex temp
Definition: bl1_axpyv2b.c:301
double real
Definition: blis_type_defs.h:139

◆ bl1_zinverts()

void bl1_zinverts ( conj1_t  conj,
dcomplex alpha 
)

References bl1_is_conj(), dcomplex::imag, dcomplex::real, and temp.

Referenced by FLA_Trinv_ln_opz_var1(), FLA_Trinv_ln_opz_var2(), FLA_Trinv_ln_opz_var3(), FLA_Trinv_ln_opz_var4(), FLA_Trinv_un_opz_var1(), FLA_Trinv_un_opz_var2(), FLA_Trinv_un_opz_var3(), and FLA_Trinv_un_opz_var4().

45 {
46  double temp;
47  double s, xr_s, xi_s;
48 
49  s = bl1_fmaxabs( alpha->real, alpha->imag ); \
50  xr_s = alpha->real / s;
51  xi_s = alpha->imag / s;
52  temp = xr_s * alpha->real + xi_s * alpha->imag;
53 
54  alpha->real = xr_s / temp;
55  alpha->imag = -xi_s / temp;
56 
57  if ( bl1_is_conj( conj ) )
58  bl1_zconjs( alpha );
59 }
int bl1_is_conj(conj1_t conj)
Definition: bl1_is.c:42
double imag
Definition: blis_type_defs.h:139
dcomplex temp
Definition: bl1_axpyv2b.c:301
double real
Definition: blis_type_defs.h:139

◆ bl1_zinvertv()

void bl1_zinvertv ( conj1_t  conj,
int  n,
dcomplex x,
int  incx 
)

References bl1_is_conj(), i, dcomplex::imag, dcomplex::real, and temp.

Referenced by FLA_Invert().

68 {
69  double one = 1.0;
70  double temp;
71  double s, xr_s, xi_s;
72  double conjsign;
73  dcomplex* chi;
74  int i;
75 
76  if ( bl1_is_conj( conj ) ) conjsign = one;
77  else conjsign = -one;
78 
79  for ( i = 0; i < n; ++i )
80  {
81  chi = x + i*incx;
82 
83  s = bl1_fmaxabs( chi->real, chi->imag ); \
84  xr_s = chi->real / s;
85  xi_s = chi->imag / s;
86  temp = xr_s * chi->real + xi_s * chi->imag;
87 
88  chi->real = xr_s / temp;
89  chi->imag = conjsign * xi_s / temp;
90  }
91 }
int bl1_is_conj(conj1_t conj)
Definition: bl1_is.c:42
double imag
Definition: blis_type_defs.h:139
dcomplex temp
Definition: bl1_axpyv2b.c:301
double real
Definition: blis_type_defs.h:139
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137

◆ bl1_zm1()

dcomplex bl1_zm1 ( void  )

References bl1_d0(), bl1_dm1(), dcomplex::imag, and dcomplex::real.

Referenced by FLA_Fused_Ahx_Axpy_Ax_opz_var1(), and FLA_Fused_Gerc2_Ahx_Axpy_Ax_opz_var1().

198 {
199  dcomplex x;
200  x.real = bl1_dm1();
201  x.imag = bl1_d0();
202  return x;
203 }
double bl1_dm1(void)
Definition: bl1_constants.c:182
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
double bl1_d0(void)
Definition: bl1_constants.c:118
Definition: blis_type_defs.h:137

◆ bl1_zm1h()

dcomplex bl1_zm1h ( void  )

References bl1_d0(), bl1_dm1h(), dcomplex::imag, and dcomplex::real.

166 {
167  dcomplex x;
168  x.real = bl1_dm1h();
169  x.imag = bl1_d0();
170  return x;
171 }
double imag
Definition: blis_type_defs.h:139
double bl1_dm1h(void)
Definition: bl1_constants.c:150
double real
Definition: blis_type_defs.h:139
double bl1_d0(void)
Definition: bl1_constants.c:118
Definition: blis_type_defs.h:137

◆ bl1_zm2()

dcomplex bl1_zm2 ( void  )

References bl1_d0(), bl1_dm2(), dcomplex::imag, and dcomplex::real.

230 {
231  dcomplex x;
232  x.real = bl1_dm2();
233  x.imag = bl1_d0();
234  return x;
235 }
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
double bl1_dm2(void)
Definition: bl1_constants.c:214
double bl1_d0(void)
Definition: bl1_constants.c:118
Definition: blis_type_defs.h:137

◆ bl1_zmaxabsm()

void bl1_zmaxabsm ( int  m,
int  n,
dcomplex a,
int  a_rs,
int  a_cs,
double *  maxabs 
)

References bl1_d0(), bl1_is_row_storage(), bl1_zero_dim2(), and bl1_zmaxabsv().

Referenced by FLA_Max_abs_value().

149 {
150  double zero = bl1_d0();
151  dcomplex* a_begin;
152  double maxabs_cand;
153  double maxabs_temp;
154  int inca, lda;
155  int n_iter;
156  int n_elem;
157  int j;
158 
159  // Return early if possible.
160  if ( bl1_zero_dim2( m, n ) ) { *maxabs = zero; return; }
161 
162  // Initialize with optimal values for column-major storage.
163  inca = a_rs;
164  lda = a_cs;
165  n_iter = n;
166  n_elem = m;
167 
168  // An optimization: if A is row-major, then let's access the matrix by
169  // rows instead of by columns for increased spatial locality.
170  if ( bl1_is_row_storage( a_rs, a_cs ) )
171  {
172  bl1_swap_ints( n_iter, n_elem );
173  bl1_swap_ints( lda, inca );
174  }
175 
176  // Initialize the maximum absolute value candidate to the first element.
177  bl1_zdabsval2( a, &maxabs_cand );
178 
179  for ( j = 0; j < n_iter; j++ )
180  {
181  a_begin = a + j*lda;
182 
183  bl1_zmaxabsv( n_elem,
184  a_begin, inca,
185  &maxabs_temp );
186 
187  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
188  }
189 
190  *maxabs = maxabs_cand;
191 }
void bl1_zmaxabsv(int n, dcomplex *x, int incx, double *maxabs)
Definition: bl1_maxabsv.c:76
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
double bl1_d0(void)
Definition: bl1_constants.c:118
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
Definition: blis_type_defs.h:137

◆ bl1_zmaxabsmr()

void bl1_zmaxabsmr ( uplo1_t  uplo,
int  m,
int  n,
dcomplex a,
int  a_rs,
int  a_cs,
double *  maxabs 
)

References bl1_d0(), bl1_is_row_storage(), bl1_is_upper(), bl1_zero_dim2(), and bl1_zmaxabsv().

Referenced by FLA_Max_abs_value_herm().

209 {
210  double zero = bl1_d0();
211  dcomplex* a_begin;
212  double maxabs_cand;
213  double maxabs_temp;
214  int inca, lda;
215  int n_iter;
216  int n_elem_max;
217  int n_elem;
218  int j;
219 
220  // Return early if possible.
221  if ( bl1_zero_dim2( m, n ) ) { *maxabs = zero; return; }
222 
223  // Initialize with optimal values for column-major storage.
224  n_iter = n;
225  n_elem_max = m;
226  lda = a_cs;
227  inca = a_rs;
228 
229  // An optimization: if A is row-major, then let's access the matrix by
230  // rows instead of by columns for increased spatial locality.
231  if ( bl1_is_row_storage( a_rs, a_cs ) )
232  {
233  bl1_swap_ints( n_iter, n_elem_max );
234  bl1_swap_ints( lda, inca );
235  bl1_toggle_uplo( uplo );
236  }
237 
238  // Initialize the maximum absolute value candidate to the first element.
239  bl1_zdabsval2( a, &maxabs_cand );
240 
241  if ( bl1_is_upper( uplo ) )
242  {
243  for ( j = 0; j < n_iter; j++ )
244  {
245  n_elem = bl1_min( j + 1, n_elem_max );
246  a_begin = a + j*lda;
247 
248  bl1_zmaxabsv( n_elem,
249  a_begin, inca,
250  &maxabs_temp );
251 
252  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
253  }
254  }
255  else // if ( bl1_is_lower( uplo ) )
256  {
257  for ( j = 0; j < n_iter; j++ )
258  {
259  n_elem = bl1_max( 0, n_elem_max - j );
260  a_begin = a + j*lda + j*inca;
261 
262  bl1_zmaxabsv( n_elem,
263  a_begin, inca,
264  &maxabs_temp );
265 
266  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
267  }
268  }
269 
270  *maxabs = maxabs_cand;
271 }
void bl1_zmaxabsv(int n, dcomplex *x, int incx, double *maxabs)
Definition: bl1_maxabsv.c:76
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
double bl1_d0(void)
Definition: bl1_constants.c:118
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
Definition: blis_type_defs.h:137

◆ bl1_zmaxabsv()

void bl1_zmaxabsv ( int  n,
dcomplex x,
int  incx,
double *  maxabs 
)

References i.

Referenced by bl1_zmaxabsm(), and bl1_zmaxabsmr().

77 {
78  dcomplex* chi;
79  double maxabs_cand;
80  double maxabs_temp;
81  int i;
82 
83  bl1_zdabsval2( x, &maxabs_cand );
84 
85  for ( i = 0; i < n; ++i )
86  {
87  chi = x + i*incx;
88 
89  bl1_zdabsval2( chi, &maxabs_temp );
90 
91  if ( maxabs_temp > maxabs_cand ) maxabs_cand = maxabs_temp;
92  }
93 
94  *maxabs = maxabs_cand;
95 }
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137

◆ bl1_zrandm()

void bl1_zrandm ( int  m,
int  n,
dcomplex a,
int  a_rs,
int  a_cs 
)

References bl1_is_row_storage(), bl1_zero_dim2(), and bl1_zrandv().

Referenced by FLA_Random_matrix().

116 {
117  dcomplex* a_begin;
118  int inca, lda;
119  int n_iter;
120  int n_elem;
121  int j;
122 
123  // Return early if possible.
124  if ( bl1_zero_dim2( m, n ) ) return;
125 
126  // Initialize with optimal values for column-major storage.
127  inca = a_rs;
128  lda = a_cs;
129  n_iter = n;
130  n_elem = m;
131 
132  // An optimization: if A is row-major, then let's access the matrix by
133  // rows instead of by columns for increased spatial locality.
134  if ( bl1_is_row_storage( a_rs, a_cs ) )
135  {
136  bl1_swap_ints( n_iter, n_elem );
137  bl1_swap_ints( lda, inca );
138  }
139 
140  for ( j = 0; j < n_iter; j++ )
141  {
142  a_begin = a + j*lda;
143 
144  bl1_zrandv( n_elem,
145  a_begin, inca );
146  }
147 }
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_zrandv(int n, dcomplex *x, int incx)
Definition: bl1_randv.c:52
Definition: blis_type_defs.h:137

◆ bl1_zrandmr()

void bl1_zrandmr ( uplo1_t  uplo,
diag1_t  diag,
int  m,
int  n,
dcomplex a,
int  a_rs,
int  a_cs 
)

References bl1_is_nonunit_diag(), bl1_is_row_storage(), bl1_is_unit_diag(), bl1_is_upper(), bl1_is_zero_diag(), bl1_z0(), bl1_z1(), bl1_zero_dim2(), bl1_zinvscalv(), bl1_zrands(), bl1_zrandv(), bl1_zsetv(), BLIS1_NO_CONJUGATE, and dcomplex::real.

Referenced by FLA_Random_tri_matrix().

378 {
379  dcomplex* a_begin;
380  dcomplex* ajj;
381  dcomplex one;
382  dcomplex zero;
383  dcomplex ord;
384  int lda, inca;
385  int n_iter;
386  int n_elem_max;
387  int n_elem;
388  int j;
389 
390  // Return early if possible.
391  if ( bl1_zero_dim2( m, n ) ) return;
392 
393  // Initialize with optimal values for column-major storage.
394  n_iter = n;
395  n_elem_max = m;
396  lda = a_cs;
397  inca = a_rs;
398 
399  // An optimization: if A is row-major, then let's access the matrix by
400  // rows instead of by columns to increase spatial locality.
401  if ( bl1_is_row_storage( a_rs, a_cs ) )
402  {
403  bl1_swap_ints( n_iter, n_elem_max );
404  bl1_swap_ints( lda, inca );
405  bl1_toggle_uplo( uplo );
406  }
407 
408  // Initialize some scalars.
409  one = bl1_z1();
410  zero = bl1_z0();
411  ord = bl1_z0();
412  ord.real = ( double ) bl1_max( m, n );
413 
414  if ( bl1_is_upper( uplo ) )
415  {
416  for ( j = 0; j < n_iter; j++ )
417  {
418  n_elem = bl1_min( j, n_elem_max );
419  a_begin = a + j*lda;
420 
421  // Randomize super-diagonal elements.
422  bl1_zrandv( n_elem,
423  a_begin, inca );
424 
425  // Normalize super-diagonal elements by order of the matrix.
427  n_elem,
428  &ord,
429  a_begin, inca );
430 
431  // Initialize diagonal and sub-diagonal elements only if there are
432  // elements left in the column (ie: j < n_elem_max).
433  if ( j < n_elem_max )
434  {
435  ajj = a_begin + j*inca;
436 
437  // Initialize diagonal element.
438  if ( bl1_is_unit_diag( diag ) ) *ajj = one;
439  else if ( bl1_is_zero_diag( diag ) ) *ajj = zero;
440  else if ( bl1_is_nonunit_diag( diag ) )
441  {
442  // We want positive diagonal elements between 1 and 2.
443  bl1_zrands( ajj );
444  bl1_zabsval2( ajj, ajj );
445  bl1_zadd3( ajj, &one, ajj );
446  }
447 
448  // Initialize sub-diagonal elements to zero.
449  bl1_zsetv( n_elem_max - j - 1,
450  &zero,
451  ajj + inca, inca );
452  }
453  }
454  }
455  else // if ( bl1_is_lower( uplo ) )
456  {
457  for ( j = 0; j < n_iter; j++ )
458  {
459  n_elem = bl1_min( j, n_elem_max );
460  a_begin = a + j*lda;
461 
462  // Initialize super-diagonal to zero.
463  bl1_zsetv( n_elem,
464  &zero,
465  a_begin, inca );
466 
467  // Initialize diagonal and sub-diagonal elements only if there are
468  // elements left in the column (ie: j < n_elem_max).
469  if ( j < n_elem_max )
470  {
471  ajj = a_begin + j*inca;
472 
473  // Initialize diagonal element.
474  if ( bl1_is_unit_diag( diag ) ) *ajj = one;
475  else if ( bl1_is_zero_diag( diag ) ) *ajj = zero;
476  else if ( bl1_is_nonunit_diag( diag ) )
477  {
478  // We want positive diagonal elements between 1 and 2.
479  bl1_zrands( ajj );
480  bl1_zabsval2( ajj, ajj );
481  bl1_zadd3( ajj, &one, ajj );
482  }
483 
484  // Randomize sub-diagonal elements.
485  bl1_zrandv( n_elem_max - j - 1,
486  ajj + inca, inca );
487 
488  // Normalize sub-diagonal elements by order of the matrix.
490  n_elem_max - j - 1,
491  &ord,
492  ajj + inca, inca );
493 
494  }
495  }
496  }
497 }
void bl1_zrands(dcomplex *alpha)
Definition: bl1_rands.c:29
void bl1_zinvscalv(conj1_t conj, int n, dcomplex *alpha, dcomplex *x, int incx)
Definition: bl1_invscalv.c:78
void bl1_zsetv(int m, dcomplex *sigma, dcomplex *x, int incx)
Definition: bl1_setv.c:66
dcomplex bl1_z0(void)
Definition: bl1_constants.c:133
Definition: blis_type_defs.h:81
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
double real
Definition: blis_type_defs.h:139
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
void bl1_zrandv(int n, dcomplex *x, int incx)
Definition: bl1_randv.c:52
int bl1_is_nonunit_diag(diag1_t diag)
Definition: bl1_is.c:73
int bl1_is_unit_diag(diag1_t diag)
Definition: bl1_is.c:78
int bl1_is_zero_diag(diag1_t diag)
Definition: bl1_is.c:83
Definition: blis_type_defs.h:137
dcomplex bl1_z1(void)
Definition: bl1_constants.c:69

◆ bl1_zrands()

void bl1_zrands ( dcomplex alpha)

References bl1_drands(), dcomplex::imag, and dcomplex::real.

Referenced by bl1_zrandmr(), and bl1_zrandv().

30 {
31  bl1_drands( &(alpha->real) );
32  bl1_drands( &(alpha->imag) );
33 }
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
void bl1_drands(double *alpha)
Definition: bl1_rands.c:18

◆ bl1_zrandv()

void bl1_zrandv ( int  n,
dcomplex x,
int  incx 
)

References bl1_zrands(), and i.

Referenced by bl1_zrandm(), and bl1_zrandmr().

53 {
54  dcomplex* chi;
55  int i;
56 
57  for ( i = 0; i < n; ++i )
58  {
59  chi = x + i*incx;
60 
61  bl1_zrands( chi );
62  }
63 }
void bl1_zrands(dcomplex *alpha)
Definition: bl1_rands.c:29
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137

◆ bl1_zscalediag()

void bl1_zscalediag ( conj1_t  conj,
int  offset,
int  m,
int  n,
dcomplex sigma,
dcomplex a,
int  a_rs,
int  a_cs 
)

References bl1_zscals(), and i.

Referenced by FLA_Scale_diag(), and FLA_UDdate_UT_opz_var1().

124 {
125  dcomplex* alpha;
126  dcomplex sigma_conj;
127  int i, j;
128 
129  bl1_zcopys( conj, sigma, &sigma_conj );
130 
131  i = j = 0;
132 
133  if ( offset < 0 ) i = -offset;
134  else if ( offset > 0 ) j = offset;
135 
136  while ( i < m && j < n )
137  {
138  alpha = a + i*a_rs + j*a_cs;
139 
140  bl1_zscals( &sigma_conj, alpha );
141 
142  ++i;
143  ++j;
144  }
145 }
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137
bl1_zscals(beta, rho_yz)

◆ bl1_zsetdiag()

void bl1_zsetdiag ( int  offset,
int  m,
int  n,
dcomplex sigma,
dcomplex a,
int  a_rs,
int  a_cs 
)

References i, dcomplex::imag, and dcomplex::real.

Referenced by FLA_Set_diag(), FLA_Set_offdiag(), and FLA_Triangularize().

99 {
100  dcomplex* alpha;
101  int i, j;
102 
103  i = j = 0;
104 
105  if ( offset < 0 ) i = -offset;
106  else if ( offset > 0 ) j = offset;
107 
108  while ( i < m && j < n )
109  {
110  alpha = a + i*a_rs + j*a_cs;
111 
112  alpha->real = sigma->real;
113  alpha->imag = sigma->imag;
114 
115  ++i;
116  ++j;
117  }
118 }
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137

◆ bl1_zsetm()

void bl1_zsetm ( int  m,
int  n,
dcomplex sigma,
dcomplex a,
int  a_rs,
int  a_cs 
)

References i, dcomplex::imag, and dcomplex::real.

Referenced by FLA_Bidiag_UT_u_step_ofz_var4(), FLA_Bidiag_UT_u_step_opz_var4(), FLA_Bidiag_UT_u_step_opz_var5(), FLA_Bsvd_ext_opd_var1(), FLA_Bsvd_ext_opz_var1(), FLA_Bsvd_v_opd_var1(), FLA_Bsvd_v_opd_var2(), FLA_Bsvd_v_opz_var1(), FLA_Bsvd_v_opz_var2(), FLA_Hess_UT_step_ofz_var4(), FLA_Hess_UT_step_opz_var4(), FLA_Hess_UT_step_opz_var5(), FLA_Set(), FLA_Tevd_n_opz_var1(), FLA_Tevd_v_opd_var1(), FLA_Tevd_v_opd_var2(), FLA_Tevd_v_opz_var1(), FLA_Tevd_v_opz_var2(), FLA_Tridiag_UT_l_step_ofz_var3(), and FLA_Tridiag_UT_l_step_opz_var3().

79 {
80  dcomplex* alpha;
81  int i, j;
82 
83  for ( j = 0; j < n; ++j )
84  {
85  for ( i = 0; i < m; ++i )
86  {
87  alpha = a + i*a_rs + j*a_cs;
88 
89  alpha->real = sigma->real;
90  alpha->imag = sigma->imag;
91  }
92  }
93 }
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137

◆ bl1_zsetmr()

void bl1_zsetmr ( uplo1_t  uplo,
int  m,
int  n,
dcomplex sigma,
dcomplex a,
int  a_rs,
int  a_cs 
)

References bl1_is_row_storage(), bl1_is_upper(), bl1_zero_dim2(), and bl1_zsetv().

Referenced by FLA_Setr(), and FLA_Triangularize().

173 {
174  dcomplex* a_begin;
175  int lda, inca;
176  int n_iter;
177  int n_elem_max;
178  int n_elem;
179  int j;
180 
181  // Return early if possible.
182  if ( bl1_zero_dim2( m, n ) ) return;
183 
184  // Initialize with optimal values for column-major storage.
185  n_iter = n;
186  n_elem_max = m;
187  lda = a_cs;
188  inca = a_rs;
189 
190  // An optimization: if A is row-major, then let's access the matrix by
191  // rows instead of by columns to increase spatial locality.
192  if ( bl1_is_row_storage( a_rs, a_cs ) )
193  {
194  bl1_swap_ints( n_iter, n_elem_max );
195  bl1_swap_ints( lda, inca );
196  bl1_toggle_uplo( uplo );
197  }
198 
199  if ( bl1_is_upper( uplo ) )
200  {
201  for ( j = 0; j < n_iter; j++ )
202  {
203  n_elem = bl1_min( j, n_elem_max );
204  a_begin = a + j*lda;
205 
206  bl1_zsetv( n_elem,
207  sigma,
208  a_begin, inca );
209  }
210  }
211  else // if ( bl1_is_lower( uplo ) )
212  {
213  for ( j = 0; j < n_iter; j++ )
214  {
215  n_elem = bl1_max( 0, n_elem_max - j - 1 );
216  a_begin = a + j*lda + (j + 1)*inca;
217 
218  bl1_zsetv( n_elem,
219  sigma,
220  a_begin, inca );
221  }
222  }
223 }
void bl1_zsetv(int m, dcomplex *sigma, dcomplex *x, int incx)
Definition: bl1_setv.c:66
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
Definition: blis_type_defs.h:137

◆ bl1_zsetv()

void bl1_zsetv ( int  m,
dcomplex sigma,
dcomplex x,
int  incx 
)

References i, dcomplex::imag, and dcomplex::real.

Referenced by bl1_zrandmr(), bl1_zsetmr(), FLA_Bidiag_UT_u_step_ofz_var4(), FLA_Bidiag_UT_u_step_opz_var4(), FLA_Fused_Ahx_Ax_opz_var1(), FLA_Fused_Ahx_Axpy_Ax_opz_var1(), FLA_Fused_Gerc2_Ahx_Ax_opz_var1(), FLA_Fused_Gerc2_Ahx_Axpy_Ax_opz_var1(), FLA_Fused_Her2_Ax_l_opz_var1(), FLA_Tridiag_UT_l_realify_opt(), FLA_Tridiag_UT_realify_subdiagonal_opt(), FLA_Tridiag_UT_shift_U_l_opz(), and FLA_Tridiag_UT_u_realify_opt().

67 {
68  dcomplex* chi;
69  int i;
70 
71  for ( i = 0; i < n; ++i )
72  {
73  chi = x + i*incx;
74 
75  chi->real = sigma->real;
76  chi->imag = sigma->imag;
77  }
78 }
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137

◆ bl1_zshiftdiag()

void bl1_zshiftdiag ( conj1_t  conj,
int  offset,
int  m,
int  n,
dcomplex sigma,
dcomplex a,
int  a_rs,
int  a_cs 
)

References i, dcomplex::imag, and dcomplex::real.

Referenced by FLA_Lyap_h_opz_var1(), FLA_Lyap_h_opz_var2(), FLA_Lyap_h_opz_var3(), FLA_Lyap_h_opz_var4(), FLA_Lyap_n_opz_var1(), FLA_Lyap_n_opz_var2(), FLA_Lyap_n_opz_var3(), FLA_Lyap_n_opz_var4(), and FLA_Shift_diag().

123 {
124  dcomplex* alpha;
125  dcomplex sigma_conj;
126  int i, j;
127 
128  bl1_zcopys( conj, sigma, &sigma_conj );
129 
130  i = j = 0;
131 
132  if ( offset < 0 ) i = -offset;
133  else if ( offset > 0 ) j = offset;
134 
135  while ( i < m && j < n )
136  {
137  alpha = a + i*a_rs + j*a_cs;
138 
139  alpha->real += sigma_conj.real;
140  alpha->imag += sigma_conj.imag;
141 
142  ++i;
143  ++j;
144  }
145 }
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:137

◆ bl1_zsymmize()

void bl1_zsymmize ( conj1_t  conj,
uplo1_t  uplo,
int  m,
dcomplex a,
int  a_rs,
int  a_cs 
)

References bl1_d0(), bl1_is_col_storage(), bl1_is_conj(), bl1_is_gen_storage(), bl1_is_lower(), bl1_is_row_storage(), bl1_is_upper(), bl1_zcopyv(), bl1_zero_dim1(), and dcomplex::imag.

Referenced by FLA_Hermitianize(), and FLA_Symmetrize().

354 {
355  dcomplex* a_src;
356  dcomplex* a_dst;
357  dcomplex* a_jj;
358  int rs_src, cs_src, inc_src;
359  int rs_dst, cs_dst, inc_dst;
360  int n_iter;
361  int j;
362 
363  // Return early if possible.
364  if ( bl1_zero_dim1( m ) ) return;
365 
366  // Assume A is square.
367  n_iter = m;
368 
369  // Initialize with appropriate values based on storage.
370  if ( bl1_is_col_storage( a_rs, a_cs ) && bl1_is_lower( uplo ) )
371  {
372  cs_src = 1;
373  rs_src = 0;
374  inc_src = a_cs;
375  cs_dst = a_cs;
376  rs_dst = 0;
377  inc_dst = 1;
378  }
379  else if ( bl1_is_col_storage( a_rs, a_cs ) && bl1_is_upper( uplo ) )
380  {
381  cs_src = a_cs;
382  rs_src = 0;
383  inc_src = 1;
384  cs_dst = 1;
385  rs_dst = 0;
386  inc_dst = a_cs;
387  }
388  else if ( bl1_is_row_storage( a_rs, a_cs ) && bl1_is_lower( uplo ) )
389  {
390  cs_src = 0;
391  rs_src = a_rs;
392  inc_src = 1;
393  cs_dst = 0;
394  rs_dst = 1;
395  inc_dst = a_rs;
396  }
397  else if ( bl1_is_row_storage( a_rs, a_cs ) && bl1_is_upper( uplo ) )
398  {
399  cs_src = 0;
400  rs_src = 1;
401  inc_src = a_rs;
402  cs_dst = 0;
403  rs_dst = a_rs;
404  inc_dst = 1;
405  }
406  else if ( bl1_is_gen_storage( a_rs, a_cs ) && bl1_is_lower( uplo ) )
407  {
408  // General stride with column-major tilt looks similar to column-major.
409  // General stride with row-major tilt looks similar to row-major.
410  if ( a_rs < a_cs )
411  {
412  cs_src = 1 * a_rs;
413  rs_src = 0;
414  inc_src = a_cs;
415  cs_dst = a_cs;
416  rs_dst = 0;
417  inc_dst = 1 * a_rs;
418  }
419  else // if ( a_rs > a_cs )
420  {
421  cs_src = 0;
422  rs_src = a_rs;
423  inc_src = 1 * a_cs;
424  cs_dst = 0;
425  rs_dst = 1 * a_cs;
426  inc_dst = a_rs;
427  }
428  }
429  else // if ( bl1_is_gen_storage( a_rs, a_cs ) && bl1_is_upper( uplo ) )
430  {
431  // General stride with column-major tilt looks similar to column-major.
432  // General stride with row-major tilt looks similar to row-major.
433  if ( a_rs < a_cs )
434  {
435  cs_src = a_cs;
436  rs_src = 0;
437  inc_src = 1 * a_rs;
438  cs_dst = 1 * a_rs;
439  rs_dst = 0;
440  inc_dst = a_cs;
441  }
442  else // if ( a_rs > a_cs )
443  {
444  cs_src = 0;
445  rs_src = 1 * a_cs;
446  inc_src = a_rs;
447  cs_dst = 0;
448  rs_dst = a_rs;
449  inc_dst = 1 * a_cs;
450  }
451  }
452 
453  for ( j = 0; j < n_iter; j++ )
454  {
455  a_src = a + j*cs_src + j*rs_src;
456  a_dst = a + j*cs_dst + j*rs_dst;
457 
458  bl1_zcopyv( conj,
459  j,
460  a_src, inc_src,
461  a_dst, inc_dst );
462 
463  if ( bl1_is_conj( conj ) )
464  {
465  a_jj = a + j*a_rs + j*a_cs;
466  a_jj->imag = bl1_d0();
467  }
468  }
469 }
int bl1_is_conj(conj1_t conj)
Definition: bl1_is.c:42
double imag
Definition: blis_type_defs.h:139
int bl1_is_lower(uplo1_t uplo)
Definition: bl1_is.c:49
double bl1_d0(void)
Definition: bl1_constants.c:118
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
int bl1_zero_dim1(int m)
Definition: bl1_is.c:113
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_gen_storage(int rs, int cs)
Definition: bl1_is.c:100
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
void bl1_zcopyv(conj1_t conj, int m, dcomplex *x, int incx, dcomplex *y, int incy)
Definition: bl1_copyv.c:63
Definition: blis_type_defs.h:137