libflame revision_anchor
Functions
FLA_Hevd_compute_scaling.c File Reference

(r)

Functions

FLA_Error FLA_Hevd_compute_scaling (FLA_Uplo uplo, FLA_Obj A, FLA_Obj sigma)
 

Function Documentation

◆ FLA_Hevd_compute_scaling()

FLA_Error FLA_Hevd_compute_scaling ( FLA_Uplo  uplo,
FLA_Obj  A,
FLA_Obj  sigma 
)
14{
21
24
26
27 FLA_Obj_create( dt_real, 1, 1, 0, 0, &norm );
28 FLA_Obj_create( dt_real, 1, 1, 0, 0, &safmin );
29 FLA_Obj_create( dt_real, 1, 1, 0, 0, &prec );
30 FLA_Obj_create( dt_real, 1, 1, 0, 0, &rmin );
31 FLA_Obj_create( dt_real, 1, 1, 0, 0, &rmax );
32
33 // Query safmin, precision.
36
37//FLA_Obj_show( "safmin", safmin, "%20.12e", "" );
38//FLA_Obj_show( "prec", prec, "%20.12e", "" );
39
40 // rmin = sqrt( safmin / prec );
43 FLA_Copy( rmin, rmax );
44 FLA_Sqrt( rmin );
45
46 // rmax = sqrt( 1 / ( safmin / prec ) );
48 FLA_Sqrt( rmax );
49
50//FLA_Obj_show( "rmin", rmin, "%20.12e", "" );
51//FLA_Obj_show( "rmax", rmax, "%20.12e", "" );
52
53 // Find the maximum absolute value of A.
55
56 if ( FLA_Obj_gt( norm, FLA_ZERO ) && FLA_Obj_lt( norm, rmin ) )
57 {
58 // sigma = rmin / norm;
61 }
62 else if ( FLA_Obj_gt( norm, rmax ) )
63 {
64 // sigma = rmax / norm;
67 }
68 else
69 {
70 // sigma = 1.0;
72 }
73
79
80 return FLA_SUCCESS;
81}
FLA_Error FLA_Hevd_compute_scaling_check(FLA_Uplo uplo, FLA_Obj A, FLA_Obj sigma)
Definition FLA_Hevd_compute_scaling_check.c:13
FLA_Error FLA_Copy(FLA_Obj A, FLA_Obj B)
Definition FLA_Copy.c:15
FLA_Error FLA_Inv_scal(FLA_Obj alpha, FLA_Obj A)
Definition FLA_Inv_scal.c:13
FLA_Obj FLA_ZERO
Definition FLA_Init.c:20
FLA_Obj FLA_ONE
Definition FLA_Init.c:18
FLA_Bool FLA_Obj_gt(FLA_Obj A, FLA_Obj B)
Definition FLA_Query.c:658
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
FLA_Bool FLA_Obj_lt(FLA_Obj A, FLA_Obj B)
Definition FLA_Query.c:813
FLA_Datatype FLA_Obj_datatype_proj_to_real(FLA_Obj A)
Definition FLA_Query.c:23
unsigned int FLA_Check_error_level(void)
Definition FLA_Check.c:18
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition FLA_Obj.c:588
int FLA_Datatype
Definition FLA_type_defs.h:49
FLA_Error FLA_Sqrt(FLA_Obj alpha)
Definition FLA_Sqrt.c:13
FLA_Error FLA_Invert(FLA_Conj conj, FLA_Obj x)
Definition FLA_Invert.c:13
FLA_Error FLA_Max_abs_value_herm(FLA_Uplo uplo, FLA_Obj A, FLA_Obj maxabs)
Definition FLA_Max_abs_value_herm.c:13
FLA_Error FLA_Mach_params(FLA_Machval machval, FLA_Obj val)
Definition FLA_Mach_params.c:13
int i
Definition bl1_axmyv2.c:145
Definition FLA_type_defs.h:159

References FLA_Check_error_level(), FLA_Copy(), FLA_Hevd_compute_scaling_check(), FLA_Inv_scal(), FLA_Invert(), FLA_Mach_params(), FLA_Max_abs_value_herm(), FLA_Obj_create(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_free(), FLA_Obj_gt(), FLA_Obj_lt(), FLA_ONE, FLA_Sqrt(), FLA_ZERO, and i.

Referenced by FLA_Hevd_lv_unb_var1(), and FLA_Hevd_lv_unb_var2().