libflame revision_anchor
FLA_Bidiag_UT_internal.c File Reference

(r)

Functions

FLA_Error FLA_Bidiag_UT_internal (FLA_Obj A, FLA_Obj TU, FLA_Obj TV, fla_bidiagut_t *cntl)
 

Function Documentation

◆ FLA_Bidiag_UT_internal()

FLA_Error FLA_Bidiag_UT_internal ( FLA_Obj A,
FLA_Obj TU,
FLA_Obj TV,
fla_bidiagut_t * cntl )
14{
15 FLA_Error r_val = FLA_SUCCESS;
16
17 if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
18 FLA_Bidiag_UT_internal_check( A, TU, TV, cntl );
19
20 if ( FLA_Obj_length( A ) >= FLA_Obj_width( A ) )
21 {
22 r_val = FLA_Bidiag_UT_u( A, TU, TV, cntl );
23 }
24 else // if ( FLA_Obj_length( A ) < FLA_Obj_width( A ) )
25 {
26 // Flip A; swap(rs, cs), swap(m, n)
29
30 r_val = FLA_Bidiag_UT_u( A, TV, TU, cntl );
31
32 // Recover A; swap(rs, cs), swap(m, n)
35
36 // According to the UT transform, the house-holder vectors are conjugated
37 // when they are applied from the right.
38 if ( FLA_Obj_is_complex( A ) )
39 {
40 FLA_Obj ATL, ATR,
41 ABL, ABR;
42 dim_t b;
43
44 FLA_Conjugate( TU );
45 FLA_Conjugate( TV );
46
47 // U
48 b = ( FLA_Obj_length( A ) - 1 );
49 FLA_Part_2x2( A, &ATL, &ATR,
50 &ABL, &ABR, 2, b, FLA_TL );
51 FLA_Conjugate_r( FLA_LOWER_TRIANGULAR, ABL );
52
53 // V
54 b = ( FLA_Obj_width( A ) - 1 );
55 FLA_Part_1x2( A, &ATL, &ATR, b, FLA_RIGHT );
56 FLA_Conjugate_r( FLA_UPPER_TRIANGULAR, ATR );
57 }
58 }
59
60 return r_val;
61}
FLA_Error FLA_Bidiag_UT_u(FLA_Obj A, FLA_Obj TU, FLA_Obj TV, fla_bidiagut_t *cntl)
Definition FLA_Bidiag_UT_u.c:13
FLA_Error FLA_Bidiag_UT_internal_check(FLA_Obj A, FLA_Obj TU, FLA_Obj TV, fla_bidiagut_t *cntl)
Definition FLA_Bidiag_UT_internal_check.c:13
FLA_Error FLA_Part_2x2(FLA_Obj A, FLA_Obj *A11, FLA_Obj *A12, FLA_Obj *A21, FLA_Obj *A22, dim_t mb, dim_t nb, FLA_Quadrant quadrant)
Definition FLA_View.c:17
FLA_Error FLA_Obj_flip_view(FLA_Obj *obj)
Definition FLA_Obj.c:669
FLA_Error FLA_Obj_flip_base(FLA_Obj *obj)
Definition FLA_Obj.c:647
dim_t FLA_Obj_width(FLA_Obj obj)
Definition FLA_Query.c:123
FLA_Error FLA_Part_1x2(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t nb, FLA_Side side)
Definition FLA_View.c:110
dim_t FLA_Obj_length(FLA_Obj obj)
Definition FLA_Query.c:116
FLA_Bool FLA_Obj_is_complex(FLA_Obj A)
Definition FLA_Query.c:324
unsigned int FLA_Check_error_level(void)
Definition FLA_Check.c:18
int FLA_Error
Definition FLA_type_defs.h:47
unsigned long dim_t
Definition FLA_type_defs.h:71
FLA_Error FLA_Conjugate_r(FLA_Uplo uplo, FLA_Obj A)
Definition FLA_Conjugate_r.c:13
FLA_Error FLA_Conjugate(FLA_Obj A)
Definition FLA_Conjugate.c:13
Definition FLA_type_defs.h:159

References FLA_Bidiag_UT_internal_check(), FLA_Bidiag_UT_u(), FLA_Check_error_level(), FLA_Conjugate(), FLA_Conjugate_r(), FLA_Obj_flip_base(), FLA_Obj_flip_view(), FLA_Obj_is_complex(), FLA_Obj_length(), FLA_Obj_width(), FLA_Part_1x2(), and FLA_Part_2x2().

Referenced by FLA_Bidiag_UT().