libflame revision_anchor
FLA_Svd_check.c File Reference

(r)

Functions

FLA_Error FLA_Svd_check (FLA_Svd_type jobu, FLA_Svd_type jobv, FLA_Obj A, FLA_Obj s, FLA_Obj U, FLA_Obj V)
 

Function Documentation

◆ FLA_Svd_check()

FLA_Error FLA_Svd_check ( FLA_Svd_type jobu,
FLA_Svd_type jobv,
FLA_Obj A,
FLA_Obj s,
FLA_Obj U,
FLA_Obj V )
14{
15 FLA_Error e_val;
16
17 e_val = FLA_Check_valid_svd_type( jobu );
18 FLA_Check_error_code( e_val );
19
20 e_val = FLA_Check_valid_svd_type( jobv );
21 FLA_Check_error_code( e_val );
22
23 // FLA_Svd does not allow FLA_SVD_VECTORS_MIN_OVERWRITE
24 // for both jobu and jobv as V cannot be overwritten on A.
25 // Use FLA_Svd_ext to allow OVERWRITE options.
26 if ( jobu == FLA_SVD_VECTORS_MIN_OVERWRITE ||
27 jobv == FLA_SVD_VECTORS_MIN_OVERWRITE )
28 FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
29
30 // Do not check the jobu and jobv OVERWRITE combination.
31 //e_val = FLA_Check_valid_svd_type_combination( jobu, jobv );
32 //FLA_Check_error_code( e_val );
33
34 e_val = FLA_Check_floating_object( A );
35 FLA_Check_error_code( e_val );
36
38 FLA_Check_error_code( e_val );
39
40 e_val = FLA_Check_real_object( s );
41 FLA_Check_error_code( e_val );
42
44 FLA_Check_error_code( e_val );
45
46 e_val = FLA_Check_vector_dim( s, FLA_Obj_min_dim( A ) );
47 FLA_Check_error_code( e_val );
48
49 e_val = FLA_Check_col_storage( s );
50 FLA_Check_error_code( e_val );
51
52 // When jobu is FLA_SVD_VECTORS_NONE, U may be given without a base object allocated.
53 if ( jobu != FLA_SVD_VECTORS_NONE && FLA_Obj_has_zero_dim( U ) == FALSE )
54 {
56 FLA_Check_error_code( e_val );
57
59 FLA_Check_error_code( e_val );
60
61 // No need to be square.
62 //e_val = FLA_Check_square( U );
63 //FLA_Check_error_code( e_val );
64 }
65
66 // When jobv is FLA_SVD_VECTORS_NONE, V may be given without a base object allocated.
67 if ( jobv != FLA_SVD_VECTORS_NONE && FLA_Obj_has_zero_dim( V ) == FALSE )
68 {
70 FLA_Check_error_code( e_val );
71
73 FLA_Check_error_code( e_val );
74
75 // No need to be square.
76 //e_val = FLA_Check_square( V );
77 //FLA_Check_error_code( e_val );
78 }
79
80 return FLA_SUCCESS;
81}
FLA_Error FLA_Check_valid_svd_type(FLA_Svd_type svd_type)
Definition FLA_Check.c:1254
dim_t FLA_Obj_width(FLA_Obj obj)
Definition FLA_Query.c:123
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition FLA_Query.c:400
FLA_Error FLA_Check_real_object(FLA_Obj A)
Definition FLA_Check.c:258
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition FLA_Check.c:298
FLA_Error FLA_Check_object_length_equals(FLA_Obj A, dim_t m)
Definition FLA_Check.c:1039
dim_t FLA_Obj_length(FLA_Obj obj)
Definition FLA_Query.c:116
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition FLA_Check.c:954
FLA_Error FLA_Check_identical_object_datatype(FLA_Obj A, FLA_Obj B)
Definition FLA_Check.c:967
FLA_Error FLA_Check_vector_dim(FLA_Obj x, dim_t expected_length)
Definition FLA_Check.c:1213
FLA_Error FLA_Check_col_storage(FLA_Obj A)
Definition FLA_Check.c:1325
dim_t FLA_Obj_min_dim(FLA_Obj obj)
Definition FLA_Query.c:153
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition FLA_Check.c:232
int FLA_Error
Definition FLA_type_defs.h:47

References FLA_Check_col_storage(), FLA_Check_floating_object(), FLA_Check_identical_object_datatype(), FLA_Check_identical_object_precision(), FLA_Check_nonconstant_object(), FLA_Check_object_length_equals(), FLA_Check_real_object(), FLA_Check_valid_svd_type(), FLA_Check_vector_dim(), FLA_Obj_has_zero_dim(), FLA_Obj_length(), FLA_Obj_min_dim(), and FLA_Obj_width().

Referenced by FLA_Svd(), and FLA_Svd_external().