libflame revision_anchor
Functions
FLA_Apply_H2_UT_r.h File Reference

(r)

Go to the source code of this file.

Functions

FLA_Error FLA_Apply_H2_UT_r_unb_var1 (FLA_Obj tau, FLA_Obj u2h, FLA_Obj a1, FLA_Obj A2)
 
FLA_Error FLA_Apply_H2_UT_r_opt_var1 (FLA_Obj tau, FLA_Obj u2h, FLA_Obj a1, FLA_Obj A2)
 
FLA_Error FLA_Apply_H2_UT_r_ops_var1 (int n_u2h_A2, int m_a1, float *tau, float *u2h, int inc_u2h, float *a1, int inc_a1, float *A2, int rs_A2, int cs_A2)
 
FLA_Error FLA_Apply_H2_UT_r_opd_var1 (int n_u2h_A2, int m_a1, double *tau, double *u2h, int inc_u2h, double *a1, int inc_a1, double *A2, int rs_A2, int cs_A2)
 
FLA_Error FLA_Apply_H2_UT_r_opc_var1 (int n_u2h_A2, int m_a1, scomplex *tau, scomplex *u2h, int inc_u2h, scomplex *a1, int inc_a1, scomplex *A2, int rs_A2, int cs_A2)
 
FLA_Error FLA_Apply_H2_UT_r_opz_var1 (int n_u2h_A2, int m_a1, dcomplex *tau, dcomplex *u2h, int inc_u2h, dcomplex *a1, int inc_a1, dcomplex *A2, int rs_A2, int cs_A2)
 

Function Documentation

◆ FLA_Apply_H2_UT_r_opc_var1()

FLA_Error FLA_Apply_H2_UT_r_opc_var1 ( int  n_u2h_A2,
int  m_a1,
scomplex tau,
scomplex u2h,
int  inc_u2h,
scomplex a1,
int  inc_a1,
scomplex A2,
int  rs_A2,
int  cs_A2 
)
260{
263 int inc_w1;
264
265 // FLA_Obj w1;
266 scomplex* w1;
267
268 if ( m_a1 == 0 || ( tau->real == 0.0F && tau->imag == 0.0F ) ) return FLA_SUCCESS;
269
270 // FLA_Obj_create_conf_to( FLA_NO_TRANSPOSE, a1, &w1 );
271 w1 = ( scomplex* ) FLA_malloc( m_a1 * sizeof( *a1 ) );
272 inc_w1 = 1;
273
274 // // w1 = a1;
275 // FLA_Copy_external( a1, w1 );
277 m_a1,
278 a1, inc_a1,
279 w1, inc_w1 );
280
281 // // w1 = w1 + A2 * u2;
282 // FLA_Gemv_external( FLA_NO_TRANSPOSE, FLA_ONE, A2, u2, FLA_ONE, w1 );
285 m_a1,
286 n_u2_A2,
287 one_p,
288 A2, rs_A2, cs_A2,
289 u2, inc_u2,
290 one_p,
291 w1, inc_w1 );
292
293 // // w1 = w1 / tau;
294 // FLA_Inv_scal_external( tau, w1 );
296 m_a1,
297 tau,
298 w1, inc_w1 );
299
300 // // a1 = a1 - w1;
301 // FLA_Axpy_external( FLA_MINUS_ONE, w1, a1 );
303 m_a1,
305 w1, inc_w1,
306 a1, inc_a1 );
307
308 // // A2 = A2 - w1 * u2';
309 // FLA_Gerc( FLA_NO_CONJUGATE, FLA_CONJUGATE, FLA_MINUS_ONE, w1, u2, A2 );
312 m_a1,
313 n_u2_A2,
315 w1, inc_w1,
316 u2, inc_u2,
317 A2, rs_A2, cs_A2 );
318
319 // FLA_Obj_free( &w1 );
320 FLA_free( w1 );
321
322 return FLA_SUCCESS;
323}
FLA_Obj FLA_MINUS_ONE
Definition FLA_Init.c:22
FLA_Obj FLA_ONE
Definition FLA_Init.c:18
void FLA_free(void *ptr)
Definition FLA_Memory.c:247
void * FLA_malloc(size_t size)
Definition FLA_Memory.c:111
int i
Definition bl1_axmyv2.c:145
void bl1_caxpyv(conj1_t conj, int n, scomplex *alpha, scomplex *x, int incx, scomplex *y, int incy)
Definition bl1_axpyv.c:29
void bl1_ccopyv(conj1_t conj, int m, scomplex *x, int incx, scomplex *y, int incy)
Definition bl1_copyv.c:49
double *restrict w1
Definition bl1_dotsv3.c:172
void bl1_cgemv(trans1_t transa, conj1_t conjx, int m, int n, scomplex *alpha, scomplex *a, int a_rs, int a_cs, scomplex *x, int incx, scomplex *beta, scomplex *y, int incy)
Definition bl1_gemv.c:125
void bl1_cger(conj1_t conjx, conj1_t conjy, int m, int n, scomplex *alpha, scomplex *x, int incx, scomplex *y, int incy, scomplex *a, int a_rs, int a_cs)
Definition bl1_ger.c:111
void bl1_cinvscalv(conj1_t conj, int n, scomplex *alpha, scomplex *x, int incx)
Definition bl1_invscalv.c:52
@ BLIS1_NO_TRANSPOSE
Definition blis_type_defs.h:54
@ BLIS1_CONJUGATE
Definition blis_type_defs.h:82
@ BLIS1_NO_CONJUGATE
Definition blis_type_defs.h:81
Definition blis_type_defs.h:133

References bl1_caxpyv(), bl1_ccopyv(), bl1_cgemv(), bl1_cger(), bl1_cinvscalv(), BLIS1_CONJUGATE, BLIS1_NO_CONJUGATE, BLIS1_NO_TRANSPOSE, FLA_free(), FLA_malloc(), FLA_MINUS_ONE, FLA_ONE, i, and w1.

Referenced by FLA_Apply_H2_UT_r_opt_var1(), FLA_Bidiag_UT_u_step_opc_var1(), FLA_Hess_UT_step_opc_var1(), FLA_LQ_UT_opc_var1(), and FLA_LQ_UT_opc_var2().

◆ FLA_Apply_H2_UT_r_opd_var1()

FLA_Error FLA_Apply_H2_UT_r_opd_var1 ( int  n_u2h_A2,
int  m_a1,
double tau,
double u2h,
int  inc_u2h,
double a1,
int  inc_a1,
double A2,
int  rs_A2,
int  cs_A2 
)
187{
188 double* one_p = FLA_DOUBLE_PTR( FLA_ONE );
190 int inc_w1;
191
192 // FLA_Obj w1;
193 double* w1;
194
195 if ( m_a1 == 0 || *tau == 0.0 ) return FLA_SUCCESS;
196
197 // FLA_Obj_create_conf_to( FLA_NO_TRANSPOSE, a1, &w1 );
198 w1 = ( double* ) FLA_malloc( m_a1 * sizeof( *a1 ) );
199 inc_w1 = 1;
200
201 // // w1 = a1;
202 // FLA_Copy_external( a1, w1 );
204 m_a1,
205 a1, inc_a1,
206 w1, inc_w1 );
207
208 // // w1 = w1 + A2 * u2;
209 // FLA_Gemv_external( FLA_NO_TRANSPOSE, FLA_ONE, A2, u2, FLA_ONE, w1 );
212 m_a1,
213 n_u2_A2,
214 one_p,
215 A2, rs_A2, cs_A2,
216 u2, inc_u2,
217 one_p,
218 w1, inc_w1 );
219
220 // // w1 = w1 / tau;
221 // FLA_Inv_scal_external( tau, w1 );
223 m_a1,
224 tau,
225 w1, inc_w1 );
226
227 // // a1 = a1 - w1;
228 // FLA_Axpy_external( FLA_MINUS_ONE, w1, a1 );
230 m_a1,
232 w1, inc_w1,
233 a1, inc_a1 );
234
235 // // A2 = A2 - w1 * u2';
236 // FLA_Gerc( FLA_NO_CONJUGATE, FLA_CONJUGATE, FLA_MINUS_ONE, w1, u2, A2 );
239 m_a1,
240 n_u2_A2,
242 w1, inc_w1,
243 u2, inc_u2,
244 A2, rs_A2, cs_A2 );
245
246 // FLA_Obj_free( &w1 );
247 FLA_free( w1 );
248
249 return FLA_SUCCESS;
250}
void bl1_daxpyv(conj1_t conj, int n, double *alpha, double *x, int incx, double *y, int incy)
Definition bl1_axpyv.c:21
void bl1_dcopyv(conj1_t conj, int m, double *x, int incx, double *y, int incy)
Definition bl1_copyv.c:42
void bl1_dgemv(trans1_t transa, conj1_t conjx, int m, int n, double *alpha, double *a, int a_rs, int a_cs, double *x, int incx, double *beta, double *y, int incy)
Definition bl1_gemv.c:69
void bl1_dger(conj1_t conjx, conj1_t conjy, int m, int n, double *alpha, double *x, int incx, double *y, int incy, double *a, int a_rs, int a_cs)
Definition bl1_ger.c:62
void bl1_dinvscalv(conj1_t conj, int n, double *alpha, double *x, int incx)
Definition bl1_invscalv.c:26

References bl1_daxpyv(), bl1_dcopyv(), bl1_dgemv(), bl1_dger(), bl1_dinvscalv(), BLIS1_CONJUGATE, BLIS1_NO_CONJUGATE, BLIS1_NO_TRANSPOSE, FLA_free(), FLA_malloc(), FLA_MINUS_ONE, FLA_ONE, i, and w1.

Referenced by FLA_Apply_H2_UT_r_opt_var1(), FLA_Bidiag_UT_u_step_opd_var1(), FLA_Hess_UT_step_opd_var1(), FLA_LQ_UT_opd_var1(), and FLA_LQ_UT_opd_var2().

◆ FLA_Apply_H2_UT_r_ops_var1()

FLA_Error FLA_Apply_H2_UT_r_ops_var1 ( int  n_u2h_A2,
int  m_a1,
float tau,
float u2h,
int  inc_u2h,
float a1,
int  inc_a1,
float A2,
int  rs_A2,
int  cs_A2 
)
114{
115 float* one_p = FLA_FLOAT_PTR( FLA_ONE );
117 int inc_w1;
118
119 // FLA_Obj w1;
120 float* w1;
121
122 if ( m_a1 == 0 || *tau == 0.0F ) return FLA_SUCCESS;
123
124 // FLA_Obj_create_conf_to( FLA_NO_TRANSPOSE, a1, &w1 );
125 w1 = ( float* ) FLA_malloc( m_a1 * sizeof( *a1 ) );
126 inc_w1 = 1;
127
128 // // w1 = a1;
129 // FLA_Copy_external( a1, w1 );
131 m_a1,
132 a1, inc_a1,
133 w1, inc_w1 );
134
135 // // w1 = w1 + A2 * u2;
136 // FLA_Gemv_external( FLA_NO_TRANSPOSE, FLA_ONE, A2, u2, FLA_ONE, w1 );
139 m_a1,
140 n_u2_A2,
141 one_p,
142 A2, rs_A2, cs_A2,
143 u2, inc_u2,
144 one_p,
145 w1, inc_w1 );
146
147 // // w1 = w1 / tau;
148 // FLA_Inv_scal_external( tau, w1 );
150 m_a1,
151 tau,
152 w1, inc_w1 );
153
154 // // a1 = a1 - w1;
155 // FLA_Axpy_external( FLA_MINUS_ONE, w1, a1 );
157 m_a1,
159 w1, inc_w1,
160 a1, inc_a1 );
161
162 // // A2 = A2 - w1 * u2';
163 // FLA_Gerc( FLA_NO_CONJUGATE, FLA_CONJUGATE, FLA_MINUS_ONE, w1, u2, A2 );
166 m_a1,
167 n_u2_A2,
169 w1, inc_w1,
170 u2, inc_u2,
171 A2, rs_A2, cs_A2 );
172
173 // FLA_Obj_free( &w1 );
174 FLA_free( w1 );
175
176 return FLA_SUCCESS;
177}
void bl1_saxpyv(conj1_t conj, int n, float *alpha, float *x, int incx, float *y, int incy)
Definition bl1_axpyv.c:13
void bl1_scopyv(conj1_t conj, int m, float *x, int incx, float *y, int incy)
Definition bl1_copyv.c:35
void bl1_sgemv(trans1_t transa, conj1_t conjx, int m, int n, float *alpha, float *a, int a_rs, int a_cs, float *x, int incx, float *beta, float *y, int incy)
Definition bl1_gemv.c:13
void bl1_sger(conj1_t conjx, conj1_t conjy, int m, int n, float *alpha, float *x, int incx, float *y, int incy, float *a, int a_rs, int a_cs)
Definition bl1_ger.c:13
void bl1_sinvscalv(conj1_t conj, int n, float *alpha, float *x, int incx)
Definition bl1_invscalv.c:13

References bl1_saxpyv(), bl1_scopyv(), bl1_sgemv(), bl1_sger(), bl1_sinvscalv(), BLIS1_CONJUGATE, BLIS1_NO_CONJUGATE, BLIS1_NO_TRANSPOSE, FLA_free(), FLA_malloc(), FLA_MINUS_ONE, FLA_ONE, i, and w1.

Referenced by FLA_Apply_H2_UT_r_opt_var1(), FLA_Bidiag_UT_u_step_ops_var1(), FLA_Hess_UT_step_ops_var1(), FLA_LQ_UT_ops_var1(), and FLA_LQ_UT_ops_var2().

◆ FLA_Apply_H2_UT_r_opt_var1()

FLA_Error FLA_Apply_H2_UT_r_opt_var1 ( FLA_Obj  tau,
FLA_Obj  u2h,
FLA_Obj  a1,
FLA_Obj  A2 
)
14{
15 FLA_Datatype datatype;
16 int n_u2_A2;
17 int m_a1;
18 int inc_u2;
19 int inc_a1;
20 int rs_A2, cs_A2;
21
22 // The house-holder transformation in libFLAME never creates a zero tau value.
23 // However, when libFLAME is mixed with LAPACK, zero tau means to apply an
24 // identity matrix that does nothing here.
26
27 datatype = FLA_Obj_datatype( A2 );
28
35
36 switch ( datatype )
37 {
38 case FLA_FLOAT:
39 {
40 float* tau_p = ( float* ) FLA_FLOAT_PTR( tau );
41 float* u2_p = ( float* ) FLA_FLOAT_PTR( u2 );
42 float* a1_p = ( float* ) FLA_FLOAT_PTR( a1 );
43 float* A2_p = ( float* ) FLA_FLOAT_PTR( A2 );
44
45 if ( *tau_p != 0.0F )
47 tau_p,
48 u2_p, inc_u2,
49 a1_p, inc_a1,
50 A2_p, rs_A2, cs_A2 );
51 break;
52 }
53
54 case FLA_DOUBLE:
55 {
56 double* tau_p = ( double* ) FLA_DOUBLE_PTR( tau );
57 double* u2_p = ( double* ) FLA_DOUBLE_PTR( u2 );
58 double* a1_p = ( double* ) FLA_DOUBLE_PTR( a1 );
59 double* A2_p = ( double* ) FLA_DOUBLE_PTR( A2 );
60
61 if ( *tau_p != 0.0 )
63 tau_p,
64 u2_p, inc_u2,
65 a1_p, inc_a1,
66 A2_p, rs_A2, cs_A2 );
67 break;
68 }
69
70 case FLA_COMPLEX:
71 {
76
77 if ( tau_p->real != 0.0F && tau_p->imag != 0.0F )
79 tau_p,
80 u2_p, inc_u2,
81 a1_p, inc_a1,
82 A2_p, rs_A2, cs_A2 );
83 break;
84 }
85
87 {
92
93 if ( tau_p->real != 0.0 && tau_p->imag != 0.0 )
95 tau_p,
96 u2_p, inc_u2,
97 a1_p, inc_a1,
98 A2_p, rs_A2, cs_A2 );
99 break;
100 }
101 }
102
103 return FLA_SUCCESS;
104}
FLA_Error FLA_Apply_H2_UT_r_opc_var1(int m_a1, int n_u2_A2, scomplex *tau, scomplex *u2, int inc_u2, scomplex *a1, int inc_a1, scomplex *A2, int rs_A2, int cs_A2)
Definition FLA_Apply_H2_UT_r_opt_var1.c:254
FLA_Error FLA_Apply_H2_UT_r_opd_var1(int m_a1, int n_u2_A2, double *tau, double *u2, int inc_u2, double *a1, int inc_a1, double *A2, int rs_A2, int cs_A2)
Definition FLA_Apply_H2_UT_r_opt_var1.c:181
FLA_Error FLA_Apply_H2_UT_r_opz_var1(int m_a1, int n_u2_A2, dcomplex *tau, dcomplex *u2, int inc_u2, dcomplex *a1, int inc_a1, dcomplex *A2, int rs_A2, int cs_A2)
Definition FLA_Apply_H2_UT_r_opt_var1.c:327
FLA_Error FLA_Apply_H2_UT_r_ops_var1(int m_a1, int n_u2_A2, float *tau, float *u2, int inc_u2, float *a1, int inc_a1, float *A2, int rs_A2, int cs_A2)
Definition FLA_Apply_H2_UT_r_opt_var1.c:108
FLA_Obj FLA_ZERO
Definition FLA_Init.c:20
dim_t FLA_Obj_width(FLA_Obj obj)
Definition FLA_Query.c:123
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition FLA_Query.c:400
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition FLA_Query.c:167
dim_t FLA_Obj_length(FLA_Obj obj)
Definition FLA_Query.c:116
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition FLA_Query.c:174
FLA_Bool FLA_Obj_equals(FLA_Obj A, FLA_Obj B)
Definition FLA_Query.c:507
dim_t FLA_Obj_vector_inc(FLA_Obj obj)
Definition FLA_Query.c:145
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition FLA_Query.c:13
int FLA_Datatype
Definition FLA_type_defs.h:49
Definition blis_type_defs.h:138

References FLA_Apply_H2_UT_r_opc_var1(), FLA_Apply_H2_UT_r_opd_var1(), FLA_Apply_H2_UT_r_ops_var1(), FLA_Apply_H2_UT_r_opz_var1(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_equals(), FLA_Obj_has_zero_dim(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_vector_inc(), FLA_Obj_width(), FLA_ZERO, and i.

Referenced by FLA_Apply_H2_UT_internal().

◆ FLA_Apply_H2_UT_r_opz_var1()

FLA_Error FLA_Apply_H2_UT_r_opz_var1 ( int  n_u2h_A2,
int  m_a1,
dcomplex tau,
dcomplex u2h,
int  inc_u2h,
dcomplex a1,
int  inc_a1,
dcomplex A2,
int  rs_A2,
int  cs_A2 
)
333{
336 int inc_w1;
337
338 // FLA_Obj w1;
339 dcomplex* w1;
340
341 if ( m_a1 == 0 || ( tau->real == 0.0 && tau->imag == 0.0 ) ) return FLA_SUCCESS;
342
343 // FLA_Obj_create_conf_to( FLA_NO_TRANSPOSE, a1, &w1 );
344 w1 = ( dcomplex* ) FLA_malloc( m_a1 * sizeof( *a1 ) );
345 inc_w1 = 1;
346
347 // // w1 = a1;
348 // FLA_Copy_external( a1, w1 );
350 m_a1,
351 a1, inc_a1,
352 w1, inc_w1 );
353
354 // // w1 = w1 + A2 * u2;
355 // FLA_Gemv_external( FLA_NO_TRANSPOSE, FLA_ONE, A2, u2, FLA_ONE, w1 );
358 m_a1,
359 n_u2_A2,
360 one_p,
361 A2, rs_A2, cs_A2,
362 u2, inc_u2,
363 one_p,
364 w1, inc_w1 );
365
366 // // w1 = w1 / tau;
367 // FLA_Inv_scal_external( tau, w1 );
369 m_a1,
370 tau,
371 w1, inc_w1 );
372
373 // // a1 = a1 - w1;
374 // FLA_Axpy_external( FLA_MINUS_ONE, w1, a1 );
376 m_a1,
378 w1, inc_w1,
379 a1, inc_a1 );
380
381 // // A2 = A2 - w1 * u2';
382 // FLA_Gerc( FLA_NO_CONJUGATE, FLA_CONJUGATE, FLA_MINUS_ONE, w1, u2, A2 );
385 m_a1,
386 n_u2_A2,
388 w1, inc_w1,
389 u2, inc_u2,
390 A2, rs_A2, cs_A2 );
391
392 // FLA_Obj_free( &w1 );
393 FLA_free( w1 );
394
395 return FLA_SUCCESS;
396}
void bl1_zaxpyv(conj1_t conj, int n, dcomplex *alpha, dcomplex *x, int incx, dcomplex *y, int incy)
Definition bl1_axpyv.c:60
void bl1_zcopyv(conj1_t conj, int m, dcomplex *x, int incx, dcomplex *y, int incy)
Definition bl1_copyv.c:63
void bl1_zgemv(trans1_t transa, conj1_t conjx, int m, int n, dcomplex *alpha, dcomplex *a, int a_rs, int a_cs, dcomplex *x, int incx, dcomplex *beta, dcomplex *y, int incy)
Definition bl1_gemv.c:255
void bl1_zger(conj1_t conjx, conj1_t conjy, int m, int n, dcomplex *alpha, dcomplex *x, int incx, dcomplex *y, int incy, dcomplex *a, int a_rs, int a_cs)
Definition bl1_ger.c:194
void bl1_zinvscalv(conj1_t conj, int n, dcomplex *alpha, dcomplex *x, int incx)
Definition bl1_invscalv.c:78

References bl1_zaxpyv(), bl1_zcopyv(), bl1_zgemv(), bl1_zger(), bl1_zinvscalv(), BLIS1_CONJUGATE, BLIS1_NO_CONJUGATE, BLIS1_NO_TRANSPOSE, FLA_free(), FLA_malloc(), FLA_MINUS_ONE, FLA_ONE, i, and w1.

Referenced by FLA_Apply_H2_UT_r_opt_var1(), FLA_Bidiag_UT_u_step_opz_var1(), FLA_Hess_UT_step_opz_var1(), FLA_LQ_UT_opz_var1(), and FLA_LQ_UT_opz_var2().

◆ FLA_Apply_H2_UT_r_unb_var1()

FLA_Error FLA_Apply_H2_UT_r_unb_var1 ( FLA_Obj  tau,
FLA_Obj  u2h,
FLA_Obj  a1,
FLA_Obj  A2 
)
58{
59 FLA_Obj w1;
60
62
63 // w1 = a1;
66
67 // w1 = w1 + A2 * u2;
69
70 // w1 = w1 / tau;
72
73 // a1 = a1 - w1;
75
76 // A2 = A2 - w1 * u2';
78
79 FLA_Obj_free( &w1 );
80
81 return FLA_SUCCESS;
82}
FLA_Error FLA_Inv_scal_external(FLA_Obj alpha, FLA_Obj A)
Definition FLA_Inv_scal_external.c:13
FLA_Error FLA_Axpy_external(FLA_Obj alpha, FLA_Obj A, FLA_Obj B)
Definition FLA_Axpy_external.c:13
FLA_Error FLA_Copy_external(FLA_Obj A, FLA_Obj B)
Definition FLA_Copy_external.c:13
FLA_Error FLA_Gemv_external(FLA_Trans transa, FLA_Obj alpha, FLA_Obj A, FLA_Obj x, FLA_Obj beta, FLA_Obj y)
Definition FLA_Gemv_external.c:13
FLA_Error FLA_Gerc_external(FLA_Conj conjx, FLA_Conj conjy, FLA_Obj alpha, FLA_Obj x, FLA_Obj y, FLA_Obj A)
Definition FLA_Gerc_external.c:13
FLA_Error FLA_Obj_create_conf_to(FLA_Trans trans, FLA_Obj old, FLA_Obj *obj)
Definition FLA_Obj.c:286
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition FLA_Obj.c:588
Definition FLA_type_defs.h:159

References FLA_Axpy_external(), FLA_Copy_external(), FLA_Gemv_external(), FLA_Gerc_external(), FLA_Inv_scal_external(), FLA_MINUS_ONE, FLA_Obj_create_conf_to(), FLA_Obj_equals(), FLA_Obj_free(), FLA_Obj_has_zero_dim(), FLA_ONE, FLA_ZERO, i, and w1.