libflame  revision_anchor
Functions
FLA_Chol_u_opt_var3.c File Reference

(r)

Functions

FLA_Error FLA_Chol_u_opt_var3 (FLA_Obj A)
 
FLA_Error FLA_Chol_u_ops_var3 (int mn_A, float *buff_A, int rs_A, int cs_A)
 
FLA_Error FLA_Chol_u_opd_var3 (int mn_A, double *buff_A, int rs_A, int cs_A)
 
FLA_Error FLA_Chol_u_opc_var3 (int mn_A, scomplex *buff_A, int rs_A, int cs_A)
 
FLA_Error FLA_Chol_u_opz_var3 (int mn_A, dcomplex *buff_A, int rs_A, int cs_A)
 

Function Documentation

◆ FLA_Chol_u_opc_var3()

FLA_Error FLA_Chol_u_opc_var3 ( int  mn_A,
scomplex buff_A,
int  rs_A,
int  cs_A 
)

References bl1_cher(), bl1_cinvscalv(), BLIS1_CONJUGATE, BLIS1_NO_CONJUGATE, BLIS1_UPPER_TRIANGULAR, FLA_MINUS_ONE, and i.

Referenced by FLA_Chol_u_opt_var3().

169 {
170  float* buff_m1 = FLA_FLOAT_PTR( FLA_MINUS_ONE );
171  int i;
172  FLA_Error e_val;
173 
174  for ( i = 0; i < mn_A; ++i )
175  {
176  scomplex* alpha11 = buff_A + (i )*cs_A + (i )*rs_A;
177  scomplex* a12t = buff_A + (i+1)*cs_A + (i )*rs_A;
178  scomplex* A22 = buff_A + (i+1)*cs_A + (i+1)*rs_A;
179 
180  int mn_ahead = mn_A - i - 1;
181  int mn_behind = i;
182 
183  /*------------------------------------------------------------*/
184 
185  // r_val = FLA_Sqrt( alpha11 );
186  // if ( r_val != FLA_SUCCESS )
187  // return ( FLA_Obj_length( A00 ) + 1 );
188  bl1_csqrte( alpha11, &e_val );
189  if ( e_val != FLA_SUCCESS ) return mn_behind;
190 
191  // FLA_Inv_scal_external( alpha11, a12t );
193  mn_ahead,
194  alpha11,
195  a12t, cs_A );
196 
197  // FLA_Herc_external( FLA_UPPER_TRIANGULAR, FLA_MINUS_ONE, a12t, A22 );
200  mn_ahead,
201  buff_m1,
202  a12t, cs_A,
203  A22, rs_A, cs_A );
204 
205  /*------------------------------------------------------------*/
206 
207  }
208 
209  return FLA_SUCCESS;
210 }
FLA_Obj FLA_MINUS_ONE
Definition: FLA_Init.c:22
Definition: blis_type_defs.h:81
Definition: blis_type_defs.h:82
int FLA_Error
Definition: FLA_type_defs.h:47
void bl1_cher(uplo1_t uplo, conj1_t conj, int m, float *alpha, scomplex *x, int incx, scomplex *a, int a_rs, int a_cs)
Definition: bl1_her.c:31
Definition: blis_type_defs.h:132
void bl1_cinvscalv(conj1_t conj, int n, scomplex *alpha, scomplex *x, int incx)
Definition: bl1_invscalv.c:52
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:63

◆ FLA_Chol_u_opd_var3()

FLA_Error FLA_Chol_u_opd_var3 ( int  mn_A,
double *  buff_A,
int  rs_A,
int  cs_A 
)

References bl1_dinvscalv(), bl1_dsyr(), BLIS1_NO_CONJUGATE, BLIS1_UPPER_TRIANGULAR, FLA_MINUS_ONE, and i.

Referenced by FLA_Chol_u_opt_var3().

123 {
124  double* buff_m1 = FLA_DOUBLE_PTR( FLA_MINUS_ONE );
125  int i;
126  FLA_Error e_val;
127 
128  for ( i = 0; i < mn_A; ++i )
129  {
130  double* alpha11 = buff_A + (i )*cs_A + (i )*rs_A;
131  double* a12t = buff_A + (i+1)*cs_A + (i )*rs_A;
132  double* A22 = buff_A + (i+1)*cs_A + (i+1)*rs_A;
133 
134  int mn_ahead = mn_A - i - 1;
135  int mn_behind = i;
136 
137  /*------------------------------------------------------------*/
138 
139  // r_val = FLA_Sqrt( alpha11 );
140  // if ( r_val != FLA_SUCCESS )
141  // return ( FLA_Obj_length( A00 ) + 1 );
142  bl1_dsqrte( alpha11, &e_val );
143  if ( e_val != FLA_SUCCESS ) return mn_behind;
144 
145  // FLA_Inv_scal_external( alpha11, a12t );
147  mn_ahead,
148  alpha11,
149  a12t, cs_A );
150 
151  // FLA_Herc_external( FLA_UPPER_TRIANGULAR, FLA_MINUS_ONE, a12t, A22 );
153  mn_ahead,
154  buff_m1,
155  a12t, cs_A,
156  A22, rs_A, cs_A );
157 
158  /*------------------------------------------------------------*/
159 
160  }
161 
162  return FLA_SUCCESS;
163 }
FLA_Obj FLA_MINUS_ONE
Definition: FLA_Init.c:22
Definition: blis_type_defs.h:81
int FLA_Error
Definition: FLA_type_defs.h:47
void bl1_dsyr(uplo1_t uplo, int m, double *alpha, double *x, int incx, double *a, int a_rs, int a_cs)
Definition: bl1_syr.c:57
void bl1_dinvscalv(conj1_t conj, int n, double *alpha, double *x, int incx)
Definition: bl1_invscalv.c:26
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:63

◆ FLA_Chol_u_ops_var3()

FLA_Error FLA_Chol_u_ops_var3 ( int  mn_A,
float *  buff_A,
int  rs_A,
int  cs_A 
)

References bl1_sinvscalv(), bl1_ssyr(), BLIS1_NO_CONJUGATE, BLIS1_UPPER_TRIANGULAR, FLA_MINUS_ONE, and i.

Referenced by FLA_Chol_u_opt_var3().

77 {
78  float* buff_m1 = FLA_FLOAT_PTR( FLA_MINUS_ONE );
79  int i;
80  FLA_Error e_val;
81 
82  for ( i = 0; i < mn_A; ++i )
83  {
84  float* alpha11 = buff_A + (i )*cs_A + (i )*rs_A;
85  float* a12t = buff_A + (i+1)*cs_A + (i )*rs_A;
86  float* A22 = buff_A + (i+1)*cs_A + (i+1)*rs_A;
87 
88  int mn_ahead = mn_A - i - 1;
89  int mn_behind = i;
90 
91  /*------------------------------------------------------------*/
92 
93  // r_val = FLA_Sqrt( alpha11 );
94  // if ( r_val != FLA_SUCCESS )
95  // return ( FLA_Obj_length( A00 ) + 1 );
96  bl1_ssqrte( alpha11, &e_val );
97  if ( e_val != FLA_SUCCESS ) return mn_behind;
98 
99  // FLA_Inv_scal_external( alpha11, a12t );
101  mn_ahead,
102  alpha11,
103  a12t, cs_A );
104 
105  // FLA_Herc_external( FLA_UPPER_TRIANGULAR, FLA_MINUS_ONE, a12t, A22 );
107  mn_ahead,
108  buff_m1,
109  a12t, cs_A,
110  A22, rs_A, cs_A );
111 
112  /*------------------------------------------------------------*/
113 
114  }
115 
116  return FLA_SUCCESS;
117 }
FLA_Obj FLA_MINUS_ONE
Definition: FLA_Init.c:22
Definition: blis_type_defs.h:81
int FLA_Error
Definition: FLA_type_defs.h:47
void bl1_sinvscalv(conj1_t conj, int n, float *alpha, float *x, int incx)
Definition: bl1_invscalv.c:13
void bl1_ssyr(uplo1_t uplo, int m, float *alpha, float *x, int incx, float *a, int a_rs, int a_cs)
Definition: bl1_syr.c:13
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:63

◆ FLA_Chol_u_opt_var3()

FLA_Error FLA_Chol_u_opt_var3 ( FLA_Obj  A)

References FLA_Chol_u_opc_var3(), FLA_Chol_u_opd_var3(), FLA_Chol_u_ops_var3(), FLA_Chol_u_opz_var3(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), and FLA_Obj_row_stride().

Referenced by FLA_Chol_u().

14 {
15  FLA_Error r_val = FLA_SUCCESS;
16  FLA_Datatype datatype;
17  int mn_A;
18  int rs_A, cs_A;
19 
20  datatype = FLA_Obj_datatype( A );
21 
22  mn_A = FLA_Obj_length( A );
23  rs_A = FLA_Obj_row_stride( A );
24  cs_A = FLA_Obj_col_stride( A );
25 
26 
27  switch ( datatype )
28  {
29  case FLA_FLOAT:
30  {
31  float* buff_A = FLA_FLOAT_PTR( A );
32 
33  r_val = FLA_Chol_u_ops_var3( mn_A,
34  buff_A, rs_A, cs_A );
35 
36  break;
37  }
38 
39  case FLA_DOUBLE:
40  {
41  double* buff_A = FLA_DOUBLE_PTR( A );
42 
43  r_val = FLA_Chol_u_opd_var3( mn_A,
44  buff_A, rs_A, cs_A );
45 
46  break;
47  }
48 
49  case FLA_COMPLEX:
50  {
51  scomplex* buff_A = FLA_COMPLEX_PTR( A );
52 
53  r_val = FLA_Chol_u_opc_var3( mn_A,
54  buff_A, rs_A, cs_A );
55 
56  break;
57  }
58 
59  case FLA_DOUBLE_COMPLEX:
60  {
61  dcomplex* buff_A = FLA_DOUBLE_COMPLEX_PTR( A );
62 
63  r_val = FLA_Chol_u_opz_var3( mn_A,
64  buff_A, rs_A, cs_A );
65 
66  break;
67  }
68  }
69 
70  return r_val;
71 }
FLA_Error FLA_Chol_u_opd_var3(int mn_A, double *buff_A, int rs_A, int cs_A)
Definition: FLA_Chol_u_opt_var3.c:121
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
FLA_Error FLA_Chol_u_opc_var3(int mn_A, scomplex *buff_A, int rs_A, int cs_A)
Definition: FLA_Chol_u_opt_var3.c:167
FLA_Error FLA_Chol_u_opz_var3(int mn_A, dcomplex *buff_A, int rs_A, int cs_A)
Definition: FLA_Chol_u_opt_var3.c:214
Definition: blis_type_defs.h:132
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
FLA_Error FLA_Chol_u_ops_var3(int mn_A, float *buff_A, int rs_A, int cs_A)
Definition: FLA_Chol_u_opt_var3.c:75
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
Definition: blis_type_defs.h:137

◆ FLA_Chol_u_opz_var3()

FLA_Error FLA_Chol_u_opz_var3 ( int  mn_A,
dcomplex buff_A,
int  rs_A,
int  cs_A 
)

References bl1_zher(), bl1_zinvscalv(), BLIS1_CONJUGATE, BLIS1_NO_CONJUGATE, BLIS1_UPPER_TRIANGULAR, FLA_MINUS_ONE, and i.

Referenced by FLA_Chol_u_opt_var3().

216 {
217  double* buff_m1 = FLA_DOUBLE_PTR( FLA_MINUS_ONE );
218  int i;
219  FLA_Error e_val;
220 
221  for ( i = 0; i < mn_A; ++i )
222  {
223  dcomplex* alpha11 = buff_A + (i )*cs_A + (i )*rs_A;
224  dcomplex* a12t = buff_A + (i+1)*cs_A + (i )*rs_A;
225  dcomplex* A22 = buff_A + (i+1)*cs_A + (i+1)*rs_A;
226 
227  int mn_ahead = mn_A - i - 1;
228  int mn_behind = i;
229 
230  /*------------------------------------------------------------*/
231 
232  // r_val = FLA_Sqrt( alpha11 );
233  // if ( r_val != FLA_SUCCESS )
234  // return ( FLA_Obj_length( A00 ) + 1 );
235  bl1_zsqrte( alpha11, &e_val );
236  if ( e_val != FLA_SUCCESS ) return mn_behind;
237 
238  // FLA_Inv_scal_external( alpha11, a12t );
240  mn_ahead,
241  alpha11,
242  a12t, cs_A );
243 
244  // FLA_Herc_external( FLA_UPPER_TRIANGULAR, FLA_MINUS_ONE, a12t, A22 );
247  mn_ahead,
248  buff_m1,
249  a12t, cs_A,
250  A22, rs_A, cs_A );
251 
252  /*------------------------------------------------------------*/
253 
254  }
255 
256  return FLA_SUCCESS;
257 }
void bl1_zher(uplo1_t uplo, conj1_t conj, int m, double *alpha, dcomplex *x, int incx, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_her.c:101
void bl1_zinvscalv(conj1_t conj, int n, dcomplex *alpha, dcomplex *x, int incx)
Definition: bl1_invscalv.c:78
FLA_Obj FLA_MINUS_ONE
Definition: FLA_Init.c:22
Definition: blis_type_defs.h:81
Definition: blis_type_defs.h:82
int FLA_Error
Definition: FLA_type_defs.h:47
int i
Definition: bl1_axmyv2.c:145
Definition: blis_type_defs.h:63
Definition: blis_type_defs.h:137