267{
269 double bulge = 0.0;
271
272
273 if ( shift == 0.0 )
274 {
275 double cs, oldcs;
276 double sn, oldsn = 0;
278 double a11temp, a22temp;
279
280 double* d_last = buff_d + (m_A-1)*inc_d;
281 double* e_last = buff_e + (m_A-2)*inc_e;
282
283 cs = one;
284 oldcs = one;
285
286 for (
i = 0;
i < m_A - 1; ++
i )
287 {
288 double* alpha01 = buff_e + (
i-1)*inc_e;
289 double* alpha11 = buff_d + (
i )*inc_d;
290 double* alpha12 = buff_e + (
i )*inc_e;
291 double* alpha22 = buff_d + (
i+1)*inc_d;
292
293 double* gammaL = &(buff_g[(
i )*inc_g].
real);
294 double* sigmaL = &(buff_g[(
i )*inc_g].
imag);
295 double* gammaR = &(buff_h[(
i )*inc_h].
real);
296 double* sigmaR = &(buff_h[(
i )*inc_h].
imag);
297
298 a11temp = *alpha11 * cs;
299 MAC_Givens2_opd( &a11temp,
300 alpha12,
301 &cs,
302 &sn,
303 &r );
304
305 if (
i > 0 ) *alpha01 = oldsn * r;
306
307 a11temp = oldcs * r;
308 a22temp = *alpha22 * sn;
309 MAC_Givens2_opd( &a11temp,
310 &a22temp,
311 &oldcs,
312 &oldsn,
313 alpha11 );
314
315 *gammaR = cs;
316 *sigmaR = sn;
317 *gammaL = oldcs;
318 *sigmaL = oldsn;
319 }
320
322 *d_last =
temp * oldcs;
323 *e_last =
temp * oldsn;
324
325 return FLA_SUCCESS;
326 }
327
328
329
330 for (
i = 0;
i < m_A - 1; ++
i )
331 {
332 double* alpha01 = buff_e + (
i-1)*inc_e;
333 double* alpha11 = buff_d + (
i )*inc_d;
334 double* alpha21 = &bulge;
335 double* alpha02 = &bulge;
336 double* alpha12 = buff_e + (
i )*inc_e;
337 double* alpha22 = buff_d + (
i+1)*inc_d;
338 double* alpha13 = &bulge;
339 double* alpha23 = buff_e + (
i+1)*inc_e;
340
341 double* gammaL = &(buff_g[(
i )*inc_g].
real);
342 double* sigmaL = &(buff_g[(
i )*inc_g].
imag);
343 double* gammaR = &(buff_h[(
i )*inc_h].
real);
344 double* sigmaR = &(buff_h[(
i )*inc_h].
imag);
345
346 double alpha01_new;
347 double alpha11_new;
348
349 int mn_ahead = m_A -
i - 2;
350
351
352
354 {
355 double alpha11_temp;
356 double alpha12_temp;
357
358
359
360 alpha11_temp = ( fabs( *buff_d ) - shift ) *
361 ( signof( one, *buff_d ) + ( shift / *buff_d ) );
362 alpha12_temp = *buff_e;
363
364
365 MAC_Givens2_opd( &alpha11_temp,
366 &alpha12_temp,
367 gammaR,
368 sigmaR,
369 &alpha11_new );
370
371
372
373 MAC_Apply_G_2x2_opd( gammaR,
374 sigmaR,
375 alpha11,
376 alpha21,
377 alpha12,
378 alpha22 );
379 }
380 else
381 {
382
383
384 MAC_Givens2_opd( alpha01,
385 alpha02,
386 gammaR,
387 sigmaR,
388 &alpha01_new );
389
390
391
392 *alpha01 = alpha01_new;
393 *alpha02 = 0.0;
394
395
396
397 MAC_Apply_G_2x2_opd( gammaR,
398 sigmaR,
399 alpha11,
400 alpha21,
401 alpha12,
402 alpha22 );
403 }
404
405
406 MAC_Givens2_opd( alpha11,
407 alpha21,
408 gammaL,
409 sigmaL,
410 &alpha11_new );
411
412
413
414 *alpha11 = alpha11_new;
415 *alpha21 = 0.0;
416
417 if ( mn_ahead > 0 )
418 {
419
420
421 MAC_Apply_GT_2x2_opd( gammaL,
422 sigmaL,
423 alpha12,
424 alpha22,
425 alpha13,
426 alpha23 );
427 }
428 else
429 {
430
431
432 MAC_Apply_GT_2x1_opd( gammaL,
433 sigmaL,
434 alpha12,
435 alpha22 );
436 }
437
438
439 }
440
441 return FLA_SUCCESS;
442}
int i
Definition bl1_axmyv2.c:145
dcomplex temp
Definition bl1_axpyv2b.c:301
double bl1_d1(void)
Definition bl1_constants.c:54
double real
Definition blis_type_defs.h:139
double imag
Definition blis_type_defs.h:139