libflame revision_anchor
Functions
FLA_Tevd_iteracc_n_opt_var1.c File Reference

(r)

Functions

FLA_Error FLA_Tevd_iteracc_n_ops_var1 (int m_A, int n_G, int ijTL, float *buff_d, int inc_d, float *buff_e, int inc_e, int *n_iter_perf)
 
FLA_Error FLA_Tevd_iteracc_n_opd_var1 (int m_A, int n_G, int ijTL, double *buff_d, int inc_d, double *buff_e, int inc_e, int *n_iter_perf)
 

Function Documentation

◆ FLA_Tevd_iteracc_n_opd_var1()

FLA_Error FLA_Tevd_iteracc_n_opd_var1 ( int  m_A,
int  n_G,
int  ijTL,
double buff_d,
int  inc_d,
double buff_e,
int  inc_e,
int n_iter_perf 
)
31{
33 int i, k;
34 int k_iter = 0;
35 int n_deflations = 0;
36
37 // Iterate from back to front until all that is left is a 2x2.
38 for ( i = m_A - 1; i > 1; --i )
39 {
40 int m_ATL = i + 1;
41 int k_left = n_G - k_iter;
42
43 /*------------------------------------------------------------*/
44
45 // Search for an eigenvalue of ATL submatrix until
46 // (a) deflation occurs, or
47 // (b) we perform the maximum number of additional iterations
48 // that are allowed within the current sweep
49 // (ie: n_G - k_iter).
51 k_left,
54 &k );
55
56 // Update local counters according to the results of the eigenvalue
57 // search.
58 k_iter += k;
59 n_deflations += 1;
60
61 // If the eigenvalue search did not result in any deflation, return.
62 if ( r_val == FLA_FAILURE )
63 {
64#ifdef PRINTF
65 printf( "FLA_Tevd_iteracc_n_opd_var1: failed to converge (m_A11 = %d) after %2d iters k_total=%d/%d\n", i, k, k_iter, n_G );
66#endif
68 return n_deflations;
69 }
70
71#ifdef PRINTF
72 if ( r_val == i )
73 printf( "FLA_Tevd_iteracc_n_opd_var1: found eig %22.15e in col %3d (n=%d) after %2d iters k_total=%d/%d\n", buff_d[ r_val*inc_d ], ijTL+r_val, m_ATL, k, k_iter, n_G );
74 else
75 printf( "FLA_Tevd_iteracc_n_opd_var1: split occurred in col %3d (n=%d) after %2d iters k_total=%d/%d\n", ijTL+r_val, m_ATL, k, k_iter, n_G );
76#endif
77
78 // If the most recent eigenvalue search put us at our limit
79 // for accumulated Givens rotation sets, return.
80 if ( k_iter == n_G )
81 {
83 return n_deflations;
84 }
85
86
87 // If r_val != i, then a split occurred somewhere within submatrix
88 // ATL. Therefore, we must recurse with two subproblems.
89 if ( r_val != i )
90 {
91 int m_TLr = r_val + 1;
92 int m_BRr = m_ATL - m_TLr;
93 int ijTLr = 0;
94 int ijBRr = m_TLr;
95 int n_Gr = n_G - k_iter;
96 double* dTL = buff_d + (0 )*inc_d;
97 double* eTL = buff_e + (0 )*inc_e;
98 double* dBR = buff_d + (ijBRr)*inc_d;
99 double* eBR = buff_e + (ijBRr)*inc_e;
100
101 int n_deflationsTL;
102 int n_deflationsBR;
103 int n_iter_perfTL;
104 int n_iter_perfBR;
105
106#ifdef PRINTF
107printf( "FLA_Tevd_iteracc_n_opd_var1: Internal deflation in col %d\n", ijTL+r_val );
108printf( "FLA_Tevd_iteracc_n_opd_var1: alpha11 = %23.19e\n", buff_d[r_val*inc_d] );
109printf( "FLA_Tevd_iteracc_n_opd_var1: alpha21 alpha22 = %23.19e %23.19e\n", buff_e[r_val*inc_e], buff_d[(r_val+1)*inc_d] );
110#endif
111#ifdef PRINTF
112printf( "FLA_Tevd_iteracc_n_opd_var1: recursing: m_TLr m_BRr: %d %d\n", m_TLr, m_BRr );
113printf( "FLA_Tevd_iteracc_n_opd_var1: ijTLr ijBRr: %d %d\n", ijTLr, ijBRr );
114printf( "FLA_Tevd_iteracc_n_opd_var1: GB(0,0) i,j: %d %d\n", ijTL + m_TLr+1, k_iter );
115#endif
117 n_Gr,
118 ijTL + ijTLr,
119 dTL, inc_d,
120 eTL, inc_e,
121 &n_iter_perfTL );
123 n_Gr,
124 ijTL + ijBRr,
125 dBR, inc_d,
126 eBR, inc_e,
127 &n_iter_perfBR );
128
130
131#ifdef PRINTF
132printf( "FLA_Tevd_iteracc_n_opd_var1: num deflations: %d = (prev:%d, TL:%d, BR:%d)\n", n_deflations + n_deflationsTL + n_deflationsBR, n_deflations, n_deflationsTL, n_deflationsBR );
133printf( "FLA_Tevd_iteracc_n_opd_var1: num iterations: %d = (prev:%d, TL:%d, BR:%d)\n", *n_iter_perf, k_iter, n_iter_perfTL, n_iter_perfBR );
134#endif
136 }
137
138 /*------------------------------------------------------------*/
139 }
140
141 // Skip 1x1 matrices (and submatrices) entirely.
142 if ( m_A > 1 )
143 {
144 double* alpha11 = buff_d + (0 )*inc_d;
145 double* alpha21 = buff_e + (0 )*inc_e;
146 double* alpha22 = buff_d + (1 )*inc_d;
147 double lambda1;
148 double lambda2;
149
150 // Find the eigenvalue decomposition of the remaining (or only) 2x2
151 // submatrix.
153 alpha21,
154 alpha22,
155 &lambda1,
156 &lambda2 );
157
158 // Store the eigenvalues.
159 *alpha11 = lambda1;
160 *alpha22 = lambda2;
161
162 // Zero out the remaining subdiagonal element.
163 *alpha21 = 0.0;
164
165 // Update the local counters.
166 k_iter += 1;
167 n_deflations += 1;
168
169#ifdef PRINTF
170printf( "FLA_Tevd_iteracc_n_opd_var1: Hevv eig %22.15e in col %3d (n=%d) after %2d iters k_total=%d/%d\n", buff_d[ 1*inc_d ], ijTL+1, 2, 1, k_iter, n_G );
171printf( "FLA_Tevd_iteracc_n_opd_var1: Hevv eig %22.15e in col %3d (n=%d) after %2d iters k_total=%d/%d\n", buff_d[ 0*inc_d ], ijTL+0, 2, 0, k_iter, n_G );
172#endif
173 }
174
175
177 return n_deflations;
178}
FLA_Error FLA_Tevd_eigval_n_opd_var1(int m_A, int n_G, double *buff_d, int inc_d, double *buff_e, int inc_e, int *n_iter)
Definition FLA_Tevd_eigval_n_opt_var1.c:78
FLA_Error FLA_Tevd_iteracc_n_opd_var1(int m_A, int n_G, int ijTL, double *buff_d, int inc_d, double *buff_e, int inc_e, int *n_iter_perf)
Definition FLA_Tevd_iteracc_n_opt_var1.c:25
int FLA_Error
Definition FLA_type_defs.h:47
FLA_Error FLA_Hev_2x2_opd(double *buff_alpha11, double *buff_alpha21, double *buff_alpha22, double *buff_lambda1, double *buff_lambda2)
Definition FLA_Hev_2x2.c:149
int i
Definition bl1_axmyv2.c:145

References FLA_Hev_2x2_opd(), FLA_Tevd_eigval_n_opd_var1(), FLA_Tevd_iteracc_n_opd_var1(), and i.

Referenced by FLA_Tevd_iteracc_n_opd_var1(), and FLA_Tevd_n_opz_var1().

◆ FLA_Tevd_iteracc_n_ops_var1()

FLA_Error FLA_Tevd_iteracc_n_ops_var1 ( int  m_A,
int  n_G,
int  ijTL,
float buff_d,
int  inc_d,
float buff_e,
int  inc_e,
int n_iter_perf 
)
19{
20 return FLA_SUCCESS;
21}

References i.