libflame  revision_anchor
Functions
bl1_conjmr.c File Reference

(r)

Functions

void bl1_sconjmr (uplo1_t uplo, int m, int n, float *a, int a_rs, int a_cs)
 
void bl1_dconjmr (uplo1_t uplo, int m, int n, double *a, int a_rs, int a_cs)
 
void bl1_cconjmr (uplo1_t uplo, int m, int n, scomplex *a, int a_rs, int a_cs)
 
void bl1_zconjmr (uplo1_t uplo, int m, int n, dcomplex *a, int a_rs, int a_cs)
 

Function Documentation

◆ bl1_cconjmr()

void bl1_cconjmr ( uplo1_t  uplo,
int  m,
int  n,
scomplex a,
int  a_rs,
int  a_cs 
)
24 {
25  float m1 = bl1_sm1();
26  float* a_conj;
27  int lda, inca;
28  int n_iter;
29  int n_elem_max;
30  int n_elem;
31  int j;
32 
33  // Return early if possible.
34  if ( bl1_zero_dim2( m, n ) ) return;
35 
36  // We initialize for column-major.
37  n_iter = n;
38  n_elem_max = m;
39  lda = a_cs;
40  inca = a_rs;
41 
42  // An optimization: if A is row-major, then let's access the matrix
43  // by rows instead of by columns to increase spatial locality.
44  if ( bl1_is_row_storage( a_rs, a_cs ) )
45  {
46  bl1_swap_ints( n_iter, n_elem_max );
47  bl1_swap_ints( lda, inca );
48  bl1_toggle_uplo( uplo );
49  }
50 
51  if ( bl1_is_upper( uplo ) )
52  {
53  for ( j = 0; j < n_iter; ++j )
54  {
55  n_elem = bl1_min( j + 1, n_elem_max );
56  a_conj = ( float* )( a + j*lda ) + 1;
57 
58  bl1_sscal( n_elem,
59  &m1,
60  a_conj, 2*inca );
61  }
62  }
63  else // if ( bl1_is_lower( uplo ) )
64  {
65  for ( j = 0; j < n_iter; ++j )
66  {
67  n_elem = bl1_max( 0, n_elem_max - j );
68  a_conj = ( float* )( a + j*lda + j*inca ) + 1;
69 
70  if ( n_elem <= 0 ) break;
71 
72  bl1_sscal( n_elem,
73  &m1,
74  a_conj, 2*inca );
75  }
76  }
77 }
void bl1_sscal(int n, float *alpha, float *x, int incx)
Definition: bl1_scal.c:13
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_upper(uplo1_t uplo)
Definition: bl1_is.c:54
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
float bl1_sm1(void)
Definition: bl1_constants.c:175

References bl1_is_row_storage(), bl1_is_upper(), bl1_sm1(), bl1_sscal(), and bl1_zero_dim2().

Referenced by bl1_chemm(), bl1_ctrmm(), bl1_ctrsm(), and FLA_Conjugate_r().

◆ bl1_dconjmr()

void bl1_dconjmr ( uplo1_t  uplo,
int  m,
int  n,
double *  a,
int  a_rs,
int  a_cs 
)
19 {
20  return;
21 }

◆ bl1_sconjmr()

void bl1_sconjmr ( uplo1_t  uplo,
int  m,
int  n,
float *  a,
int  a_rs,
int  a_cs 
)
14 {
15  return;
16 }

◆ bl1_zconjmr()

void bl1_zconjmr ( uplo1_t  uplo,
int  m,
int  n,
dcomplex a,
int  a_rs,
int  a_cs 
)
80 {
81  double m1 = bl1_dm1();
82  double* a_conj;
83  int lda, inca;
84  int n_iter;
85  int n_elem_max;
86  int n_elem;
87  int j;
88 
89  // Return early if possible.
90  if ( bl1_zero_dim2( m, n ) ) return;
91 
92  // We initialize for column-major.
93  n_iter = n;
94  n_elem_max = m;
95  lda = a_cs;
96  inca = a_rs;
97 
98  // An optimization: if A is row-major, then let's access the matrix
99  // by rows instead of by columns to increase spatial locality.
100  if ( bl1_is_row_storage( a_rs, a_cs ) )
101  {
102  bl1_swap_ints( n_iter, n_elem_max );
103  bl1_swap_ints( lda, inca );
104  bl1_toggle_uplo( uplo );
105  }
106 
107  if ( bl1_is_upper( uplo ) )
108  {
109  for ( j = 0; j < n_iter; ++j )
110  {
111  n_elem = bl1_min( j + 1, n_elem_max );
112  a_conj = ( double* )( a + j*lda ) + 1;
113 
114  bl1_dscal( n_elem,
115  &m1,
116  a_conj, 2*inca );
117  }
118  }
119  else // if ( bl1_is_lower( uplo ) )
120  {
121  for ( j = 0; j < n_iter; ++j )
122  {
123  n_elem = bl1_max( 0, n_elem_max - j );
124  a_conj = ( double* )( a + j*lda + j*inca ) + 1;
125 
126  if ( n_elem <= 0 ) break;
127 
128  bl1_dscal( n_elem,
129  &m1,
130  a_conj, 2*inca );
131  }
132  }
133 }
void bl1_dscal(int n, double *alpha, double *x, int incx)
Definition: bl1_scal.c:26
double bl1_dm1(void)
Definition: bl1_constants.c:182

References bl1_dm1(), bl1_dscal(), bl1_is_row_storage(), bl1_is_upper(), and bl1_zero_dim2().

Referenced by bl1_zhemm(), bl1_ztrmm(), bl1_ztrsm(), and FLA_Conjugate_r().