libflame revision_anchor
Functions
FLA_Hevd_lv_unb_var1.c File Reference

(r)

Functions

FLA_Error FLA_Hevd_lv_unb_var1 (dim_t n_iter_max, FLA_Obj A, FLA_Obj l, dim_t k_accum, dim_t b_alg)
 

Function Documentation

◆ FLA_Hevd_lv_unb_var1()

FLA_Error FLA_Hevd_lv_unb_var1 ( dim_t  n_iter_max,
FLA_Obj  A,
FLA_Obj  l,
dim_t  k_accum,
dim_t  b_alg 
)
14{
19 FLA_Obj scale, T, r, d, e, G;
20 dim_t mn_A;
23
28
29 // Make sure the matrix is column-stored.
30 if ( FLA_Obj_row_stride( A ) != 1 )
31 {
33 }
34
35 // If the matrix is a scalar, then the EVD is easy.
36 if ( mn_A == 1 )
37 {
38 FLA_Copy( A, l );
39 FLA_Set( FLA_ONE, A );
40
41 return FLA_SUCCESS;
42 }
43
44 // Create a matrix to hold block Householder transformations.
46
47 // Create a vector to hold the realifying scalars.
48 FLA_Obj_create( dt, mn_A, 1, 0, 0, &r );
49
50 // Create vectors to hold the diagonal and sub-diagonal.
51 FLA_Obj_create( dt_real, mn_A, 1, 0, 0, &d );
52 FLA_Obj_create( dt_real, mn_A-1, 1, 0, 0, &e );
53 FLA_Obj_create( dt_comp, mn_A-1, n_G, 0, 0, &G );
54
55 // Create a real scaling factor.
56 FLA_Obj_create( dt_real, 1, 1, 0, 0, &scale );
57
58 // Compute a scaling factor; If none is needed, sigma will be set to one.
60
61 // Scale the matrix if scale is non-unit.
62 if ( !FLA_Obj_equals( scale, FLA_ONE ) )
63 FLA_Scalr( uplo, scale, A );
64
65 // Reduce the matrix to tridiagonal form.
66 FLA_Tridiag_UT( uplo, A, T );
67
68 // Apply scalars to rotate elements on the sub-diagonal to the real domain.
69 FLA_Tridiag_UT_realify( uplo, A, r );
70
71 // Extract the diagonal and sub-diagonal from A.
73
74 // Form Q, overwriting A.
75 FLA_Tridiag_UT_form_Q( uplo, A, T, A );
76
77 // Apply the scalars in r to Q.
79
80 // Perform an eigenvalue decomposition on the tridiagonal matrix.
82
83 // Copy the converged eigenvalues to the output vector.
84 FLA_Copy( d, l );
85
86 // Sort the eigenvalues and eigenvectors in ascending order.
88
89 // If the matrix was scaled, rescale the eigenvalues.
90 if ( !FLA_Obj_equals( scale, FLA_ONE ) )
92
94 FLA_Obj_free( &T );
95 FLA_Obj_free( &r );
96 FLA_Obj_free( &d );
97 FLA_Obj_free( &e );
98 FLA_Obj_free( &G );
99
100 return r_val;
101}
FLA_Error FLA_Hevd_compute_scaling(FLA_Uplo uplo, FLA_Obj A, FLA_Obj sigma)
Definition FLA_Hevd_compute_scaling.c:13
FLA_Error FLA_Tevd_v_opt_var1(dim_t n_iter_max, FLA_Obj d, FLA_Obj e, FLA_Obj G, FLA_Obj U, dim_t b_alg)
Definition FLA_Tevd_v_opt_var1.c:13
FLA_Error FLA_Tridiag_UT(FLA_Uplo uplo, FLA_Obj A, FLA_Obj T)
Definition FLA_Tridiag_UT.c:17
FLA_Error FLA_Tridiag_UT_extract_real_diagonals(FLA_Uplo uplo, FLA_Obj A, FLA_Obj d, FLA_Obj e)
Definition FLA_Tridiag_UT_extract_real_diagonals.c:13
FLA_Error FLA_Tridiag_UT_create_T(FLA_Obj A, FLA_Obj *T)
Definition FLA_Tridiag_UT_create_T.c:13
FLA_Error FLA_Tridiag_UT_form_Q(FLA_Uplo uplo, FLA_Obj A, FLA_Obj T, FLA_Obj Q)
Definition FLA_Tridiag_UT_form_Q.c:14
FLA_Error FLA_Tridiag_UT_realify(FLA_Uplo uplo, FLA_Obj A, FLA_Obj d)
Definition FLA_Tridiag_UT_realify.c:13
FLA_Error FLA_Copy(FLA_Obj A, FLA_Obj B)
Definition FLA_Copy.c:15
FLA_Error FLA_Scalr(FLA_Uplo uplo, FLA_Obj alpha, FLA_Obj A)
Definition FLA_Scalr.c:15
FLA_Error FLA_Inv_scal(FLA_Obj alpha, FLA_Obj A)
Definition FLA_Inv_scal.c:13
FLA_Obj FLA_ONE
Definition FLA_Init.c:18
FLA_Datatype FLA_Obj_datatype_proj_to_complex(FLA_Obj A)
Definition FLA_Query.c:37
FLA_Error FLA_Obj_create(FLA_Datatype datatype, dim_t m, dim_t n, dim_t rs, dim_t cs, FLA_Obj *obj)
Definition FLA_Obj.c:55
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition FLA_Query.c:167
FLA_Datatype FLA_Obj_datatype_proj_to_real(FLA_Obj A)
Definition FLA_Query.c:23
dim_t FLA_Obj_length(FLA_Obj obj)
Definition FLA_Query.c:116
FLA_Bool FLA_Obj_equals(FLA_Obj A, FLA_Obj B)
Definition FLA_Query.c:507
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition FLA_Obj.c:588
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition FLA_Query.c:13
int FLA_Error
Definition FLA_type_defs.h:47
int FLA_Datatype
Definition FLA_type_defs.h:49
unsigned long dim_t
Definition FLA_type_defs.h:71
int FLA_Uplo
Definition FLA_type_defs.h:52
FLA_Error FLA_Set(FLA_Obj alpha, FLA_Obj A)
Definition FLA_Set.c:13
FLA_Error FLA_Sort_evd(FLA_Direct direct, FLA_Obj l, FLA_Obj V)
Definition FLA_Sort_evd.c:13
FLA_Error FLA_Apply_diag_matrix(FLA_Side side, FLA_Conj conj, FLA_Obj x, FLA_Obj A)
Definition FLA_Apply_diag_matrix.c:13
int i
Definition bl1_axmyv2.c:145
Definition FLA_type_defs.h:159

References FLA_Apply_diag_matrix(), FLA_Copy(), FLA_Hevd_compute_scaling(), FLA_Inv_scal(), FLA_Obj_create(), FLA_Obj_datatype(), FLA_Obj_datatype_proj_to_complex(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_equals(), FLA_Obj_free(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_ONE, FLA_Scalr(), FLA_Set(), FLA_Sort_evd(), FLA_Tevd_v_opt_var1(), FLA_Tridiag_UT(), FLA_Tridiag_UT_create_T(), FLA_Tridiag_UT_extract_real_diagonals(), FLA_Tridiag_UT_form_Q(), FLA_Tridiag_UT_realify(), and i.

Referenced by FLA_Hevd().