186{
189 int k_iter = 0;
190 int n_deflations = 0;
191
192
193 for (
i = m_A - 1;
i > 1; --
i )
194 {
195 dcomplex* G1 = buff_G + (k_iter)*cs_G;
196 dcomplex* H1 = buff_H + (k_iter)*cs_H;
198 int k_left = n_GH - k_iter;
199
200
201
202
204 n_GH,
205 k_left,
206 tol,
207 thresh,
208 G1, rs_G, cs_G,
209 H1, rs_H, cs_H,
210 buff_d, inc_d,
211 buff_e, inc_e,
212 &k );
213
214
215
216 k_iter += k;
217 n_deflations += 1;
218
219 if ( r_val == FLA_FAILURE )
220 {
221#ifdef PRINTF
222 printf(
"FLA_Bsvd_iteracc_v_opd_var1: failed to converge (m_A11 = %d) after %2d iters k_total=%d/%d\n",
i, k, k_iter, n_G );
223#endif
224 *n_iter_perf = k_iter;
225 return n_deflations;
226 }
227
228#ifdef PRINTF
230 printf( "FLA_Bsvd_iteracc_v_opd_var1: found sv %22.15e in col %3d (n=%d) after %2d it k_tot=%d/%d\n", buff_d[ r_val*inc_d ], ijTL+r_val, m_ATL, k, k_iter, n_GH );
231 else
232 printf( "FLA_Bsvd_iteracc_v_opd_var1: split occurred in col %3d. (n=%d) after %2d it k_tot=%d/%d\n", r_val, m_ATL, k, k_iter, n_GH );
233#endif
234
235
236
237 if ( k_iter == n_GH )
238 {
239 *n_iter_perf = k_iter;
240 return n_deflations;
241 }
242
243
244
246 {
247 int m_TLr = r_val + 1;
248 int m_BRr = m_ATL - m_TLr;
249 int ijTLr = 0;
250 int ijBRr = m_TLr;
251 int n_GHr = n_GH - k_iter;
252 double* dTL = buff_d + (0 )*inc_d;
253 double* eTL = buff_e + (0 )*inc_e;
254 dcomplex* GT = buff_G + (0 )*rs_G + (k_iter)*cs_G;
255 dcomplex* HT = buff_H + (0 )*rs_H + (k_iter)*cs_H;
256 double* dBR = buff_d + (ijBRr)*inc_d;
257 double* eBR = buff_e + (ijBRr)*inc_e;
258 dcomplex* GB = buff_G + (ijBRr)*rs_G + (k_iter)*cs_G;
259 dcomplex* HB = buff_H + (ijBRr)*rs_H + (k_iter)*cs_H;
260
261 int n_deflationsTL;
262 int n_deflationsBR;
263 int n_iter_perfTL;
264 int n_iter_perfBR;
265
266#ifdef PRINTF
267 printf( "FLA_Bsvd_iteracc_v_opd_var1: Deflation occurred in col %d\n", r_val );
268 printf( "FLA_Bsvd_iteracc_v_opd_var1: alpha11 alpha12 = %22.15e %22.15e\n", buff_d[r_val*inc_d], buff_e[(r_val)*inc_e] );
269 printf( "FLA_Bsvd_iteracc_v_opd_var1: alpha22 = %37.15e\n", buff_d[(r_val+1)*inc_d] );
270
271 printf( "FLA_Bsvd_iteracc_v_opd_var1: recursing: ijTLr m_TLr: %d %d\n", ijTLr, m_TLr );
272 printf( "FLA_Bsvd_iteracc_v_opd_var1: GB(0,0) i,j: %d %d\n", ijTL + m_TLr+1, k_iter );
273#endif
275 n_GHr,
276 ijTL + ijTLr,
277 tol,
278 thresh,
279 dTL, inc_d,
280 eTL, inc_e,
281 GT, rs_G, cs_G,
282 HT, rs_H, cs_H,
283 &n_iter_perfTL );
284#ifdef PRINTF
285 printf( "FLA_Bsvd_iteracc_v_opd_var1: returning: ijTLr m_TLr: %d %d\n", ijTLr, m_TLr );
286 printf( "FLA_Bsvd_iteracc_v_opd_var1: recursing: ijBRr m_BRr: %d %d\n", ijBRr, m_BRr );
287 printf( "FLA_Bsvd_iteracc_v_opd_var1: GB(0,0) i,j: %d %d\n", ijTL + m_TLr+1, k_iter );
288#endif
290 n_GHr,
291 ijTL + ijBRr,
292 tol,
293 thresh,
294 dBR, inc_d,
295 eBR, inc_e,
296 GB, rs_G, cs_G,
297 HB, rs_H, cs_H,
298 &n_iter_perfBR );
299#ifdef PRINTF
300 printf( "FLA_Bsvd_iteracc_v_opd_var1: returning: ijBRr m_BRr: %d %d\n", ijBRr, m_BRr );
301#endif
302
303 *n_iter_perf = k_iter + max( n_iter_perfTL, n_iter_perfBR );
304
305 return n_deflations + n_deflationsTL + n_deflationsBR;
306 }
307
308
309 }
310
311
312 if ( m_A > 1 )
313 {
314 dcomplex* g1 = buff_G + (k_iter)*cs_G;
315 dcomplex* h1 = buff_H + (k_iter)*cs_H;
316
317 double* alpha11 = buff_d + (0 )*inc_d;
318 double* alpha12 = buff_e + (0 )*inc_e;
319 double* alpha22 = buff_d + (1 )*inc_d;
320
321 double smin;
322 double smax;
323
324 double gammaL;
325 double sigmaL;
326 double gammaR;
327 double sigmaR;
328
329
330
332 alpha12,
333 alpha22,
334 &smin,
335 &smax,
336 &gammaL,
337 &sigmaL,
338 &gammaR,
339 &sigmaR );
340
341 *alpha11 = smax;
342 *alpha22 = smin;
343
344
345 *alpha12 = 0.0;
346
347
350 h1[0].real = gammaR;
351 h1[0].imag = sigmaR;
352
353
354 k_iter += 1;
355 n_deflations += 1;
356
357#ifdef PRINTF
358 printf( "FLA_Bsvd_iteracc_v_opd_var1: Svv sval %22.15e in col %3d (n=%d) after %2d it k_tot=%d/%d\n", buff_d[ 1*inc_d ], ijTL+1, 2, 1, k_iter, n_GH );
359 printf( "FLA_Bsvd_iteracc_v_opd_var1: Svv sval %22.15e in col %3d (n=%d) after %2d it k_tot=%d/%d\n", buff_d[ 0*inc_d ], ijTL+0, 2, 0, k_iter, n_GH );
360#endif
361 }
362
363 *n_iter_perf = k_iter;
364 return n_deflations;
365}
FLA_Error FLA_Bsvd_iteracc_v_opd_var1(int m_A, int n_GH, int ijTL, double tol, double thresh, double *buff_d, int inc_d, double *buff_e, int inc_e, dcomplex *buff_G, int rs_G, int cs_G, dcomplex *buff_H, int rs_H, int cs_H, int *n_iter_perf)
Definition FLA_Bsvd_iteracc_v_opt_var1.c:176
FLA_Error FLA_Bsvd_sinval_v_opd_var1(int m_A, int n_GH, int n_iter_allowed, double tol, double thresh, dcomplex *buff_G, int rs_G, int cs_G, dcomplex *buff_H, int rs_H, int cs_H, double *buff_d, int inc_d, double *buff_e, int inc_e, int *n_iter)
Definition FLA_Bsvd_sinval_v_opt_var1.c:194
int FLA_Error
Definition FLA_type_defs.h:47
FLA_Error FLA_Svv_2x2_opd(double *alpha11, double *alpha12, double *alpha22, double *sigma1, double *sigma2, double *gammaL, double *sigmaL, double *gammaR, double *sigmaR)
Definition FLA_Svv_2x2.c:290
int i
Definition bl1_axmyv2.c:145
Definition blis_type_defs.h:138
double real
Definition blis_type_defs.h:139
double imag
Definition blis_type_defs.h:139