libflame revision_anchor
Functions
FLA_Tevd_compute_scaling.c File Reference

(r)

Functions

FLA_Error FLA_Tevd_compute_scaling_ops (int m_A, float *buff_d, int inc_d, float *buff_e, int inc_e, float *sigma)
 
FLA_Error FLA_Tevd_compute_scaling_opd (int m_A, double *buff_d, int inc_d, double *buff_e, int inc_e, double *sigma)
 

Function Documentation

◆ FLA_Tevd_compute_scaling_opd()

FLA_Error FLA_Tevd_compute_scaling_opd ( int  m_A,
double buff_d,
int  inc_d,
double buff_e,
int  inc_e,
double sigma 
)
63{
64 double one = bl1_d1();
65 double three = 3.0;
66 double norm;
67 double eps2;
68 double safmin;
69 double safmax;
70 double ssfmin;
71 double ssfmax;
72
73 // Query some constants.
76 safmax = one / safmin;
77
78 // Compute the acceptable range for the 1-norm;
79 ssfmax = sqrt( safmax ) / three;
80 ssfmin = sqrt( safmin ) / eps2;
81
82 // Compute the 1-norm of the tridiagonal matrix.
86 &norm );
87
88 // Compute sigma accordingly if norm is outside of the range.
89 if ( norm > ssfmax )
90 {
91 *sigma = ssfmax / norm;
92 }
93 else if ( norm < ssfmin )
94 {
95 *sigma = ssfmin / norm;
96 }
97 else
98 {
99 *sigma = one;
100 }
101
102 return FLA_SUCCESS;
103}
FLA_Error FLA_Norm1_tridiag_opd(int m_A, double *buff_d, int inc_d, double *buff_e, int inc_e, double *norm)
Definition FLA_Norm1_tridiag.c:111
double FLA_Mach_params_opd(FLA_Machval machval)
Definition FLA_Mach_params.c:74
int i
Definition bl1_axmyv2.c:145
double bl1_d1(void)
Definition bl1_constants.c:54

References bl1_d1(), FLA_Mach_params_opd(), FLA_Norm1_tridiag_opd(), and i.

◆ FLA_Tevd_compute_scaling_ops()

FLA_Error FLA_Tevd_compute_scaling_ops ( int  m_A,
float buff_d,
int  inc_d,
float buff_e,
int  inc_e,
float sigma 
)
17{
18 float one = bl1_s1();
19 float three = 3.0F;
20 float norm;
21 float eps2;
22 float safmin;
23 float safmax;
24 float ssfmin;
25 float ssfmax;
26
27 // Query some constants.
30 safmax = one / safmin;
31
32 // Compute the acceptable range for the 1-norm;
33 ssfmax = sqrt( safmax ) / three;
34 ssfmin = sqrt( safmin ) / eps2;
35
36 // Compute the 1-norm of the tridiagonal matrix.
40 &norm );
41
42 // Compute sigma accordingly if norm is outside of the range.
43 if ( norm > ssfmax )
44 {
45 *sigma = ssfmax / norm;
46 }
47 else if ( norm < ssfmin )
48 {
49 *sigma = ssfmin / norm;
50 }
51 else
52 {
53 *sigma = one;
54 }
55
56 return FLA_SUCCESS;
57}
FLA_Error FLA_Norm1_tridiag_ops(int m_A, float *buff_d, int inc_d, float *buff_e, int inc_e, float *norm)
Definition FLA_Norm1_tridiag.c:64
float FLA_Mach_params_ops(FLA_Machval machval)
Definition FLA_Mach_params.c:47
float bl1_s1(void)
Definition bl1_constants.c:47

References bl1_s1(), FLA_Mach_params_ops(), FLA_Norm1_tridiag_ops(), and i.