libflame  revision_anchor
Functions
FLA_util_base_prototypes.h File Reference

(r)

Go to the source code of this file.

Functions

float FLA_random_float (void)
 
double FLA_random_double (void)
 
scomplex FLA_random_scomplex (void)
 
dcomplex FLA_random_dcomplex (void)
 
FLA_Error FLA_Absolute_square (FLA_Obj alpha)
 
FLA_Error FLA_Absolute_value (FLA_Obj alpha)
 
double FLA_Clock (void)
 
FLA_Error FLA_Conjugate (FLA_Obj A)
 
FLA_Error FLA_Conjugate_r (FLA_Uplo uplo, FLA_Obj A)
 
FLA_Error FLA_Fill_with_linear_dist (FLA_Obj shift, FLA_Obj delta, FLA_Obj x)
 
FLA_Error FLA_Fill_with_inverse_dist (FLA_Obj alpha, FLA_Obj x)
 
FLA_Error FLA_Fill_with_geometric_dist (FLA_Obj alpha, FLA_Obj x)
 
FLA_Error FLA_Fill_with_random_dist (FLA_Obj shift, FLA_Obj max, FLA_Obj x)
 
FLA_Error FLA_Fill_with_logarithmic_dist (FLA_Obj max, FLA_Obj x)
 
FLA_Error FLA_Fill_with_cluster_dist (FLA_Obj n_clusters, FLA_Obj cluster_width, FLA_Obj x)
 
FLA_Error FLA_Hermitianize (FLA_Uplo uplo, FLA_Obj A)
 
FLA_Error FLA_Invert (FLA_Conj conj, FLA_Obj x)
 
FLA_Error FLA_Inv_scal_elemwise (FLA_Trans trans, FLA_Obj A, FLA_Obj B)
 
FLA_Error FLA_Max_abs_value (FLA_Obj A, FLA_Obj amax)
 
FLA_Error FLA_Max_abs_value_herm (FLA_Uplo uplo, FLA_Obj A, FLA_Obj maxabs)
 
double FLA_Max_elemwise_diff (FLA_Obj A, FLA_Obj B)
 
FLA_Error FLA_Mult_add (FLA_Obj alpha, FLA_Obj beta, FLA_Obj gamma)
 
FLA_Error FLA_Negate (FLA_Obj x)
 
FLA_Error FLA_Norm1 (FLA_Obj A, FLA_Obj norm)
 
FLA_Error FLA_Norm_inf (FLA_Obj A, FLA_Obj norm)
 
FLA_Error FLA_Norm_frob (FLA_Obj A, FLA_Obj norm)
 
FLA_Error FLA_Pow (FLA_Obj base, FLA_Obj exp, FLA_Obj btoe)
 
FLA_Error FLA_Random_matrix (FLA_Obj A)
 
FLA_Error FLA_Random_herm_matrix (FLA_Uplo uplo, FLA_Obj A)
 
FLA_Error FLA_Random_symm_matrix (FLA_Uplo uplo, FLA_Obj A)
 
FLA_Error FLA_Random_spd_matrix (FLA_Uplo uplo, FLA_Obj A)
 
FLA_Error FLA_Random_tri_matrix (FLA_Uplo uplo, FLA_Diag diag, FLA_Obj A)
 
FLA_Error FLA_Random_unitary_matrix (FLA_Obj A)
 
FLA_Error FLA_Scal_elemwise (FLA_Trans trans, FLA_Obj A, FLA_Obj B)
 
FLA_Error FLA_Setr (FLA_Uplo uplo, FLA_Obj alpha, FLA_Obj A)
 
FLA_Error FLA_Shift_pivots_to_check (FLA_Pivot_type ptype, FLA_Obj p)
 
FLA_Error FLA_Sqrt (FLA_Obj alpha)
 
FLA_Error FLA_Symmetrize (FLA_Uplo uplo, FLA_Obj A)
 
FLA_Error FLA_Triangularize (FLA_Uplo uplo, FLA_Diag diag, FLA_Obj A)
 
FLA_Error FLA_Transpose (FLA_Obj A)
 
FLA_Error FLA_Set (FLA_Obj alpha, FLA_Obj A)
 
FLA_Error FLA_Set_diag (FLA_Obj alpha, FLA_Obj A)
 
FLA_Error FLA_Set_offdiag (int offset, FLA_Obj alpha, FLA_Obj A)
 
FLA_Error FLA_Set_to_identity (FLA_Obj A)
 
FLA_Error FLA_Add_to_diag (void *diag_value, FLA_Obj A)
 
FLA_Error FLA_Shift_diag (FLA_Conj conj, FLA_Obj sigma, FLA_Obj A)
 
FLA_Error FLA_Scale_diag (FLA_Conj conj, FLA_Obj alpha, FLA_Obj A)
 
FLA_Error FLA_Set_diagonal_vector (FLA_Obj A, FLA_Obj d)
 
FLA_Error FLA_Set_diagonal_matrix (FLA_Obj d, FLA_Obj A)
 
FLA_Error FLA_Absolute_square_check (FLA_Obj alpha)
 
FLA_Error FLA_Absolute_value_check (FLA_Obj alpha)
 
FLA_Error FLA_Conjugate_check (FLA_Obj A)
 
FLA_Error FLA_Conjugate_r_check (FLA_Uplo uplo, FLA_Obj A)
 
FLA_Error FLA_Fill_with_linear_dist_check (FLA_Obj shift, FLA_Obj delta, FLA_Obj x)
 
FLA_Error FLA_Fill_with_inverse_dist_check (FLA_Obj alpha, FLA_Obj x)
 
FLA_Error FLA_Fill_with_geometric_dist_check (FLA_Obj alpha, FLA_Obj x)
 
FLA_Error FLA_Fill_with_random_dist_check (FLA_Obj shift, FLA_Obj max, FLA_Obj x)
 
FLA_Error FLA_Fill_with_logarithmic_dist_check (FLA_Obj alpha, FLA_Obj x)
 
FLA_Error FLA_Fill_with_cluster_dist_check (FLA_Obj n_clusters, FLA_Obj cluster_width, FLA_Obj x)
 
FLA_Error FLA_Hermitianize_check (FLA_Uplo uplo, FLA_Obj A)
 
FLA_Error FLA_Invert_check (FLA_Conj conj, FLA_Obj x)
 
FLA_Error FLA_Inv_scal_elemwise_check (FLA_Trans trans, FLA_Obj A, FLA_Obj B)
 
FLA_Error FLA_Max_abs_value_check (FLA_Obj A, FLA_Obj amax)
 
FLA_Error FLA_Max_abs_value_herm_check (FLA_Uplo uplo, FLA_Obj A, FLA_Obj maxabs)
 
FLA_Error FLA_Max_elemwise_diff_check (FLA_Obj A, FLA_Obj B)
 
FLA_Error FLA_Mult_add_check (FLA_Obj alpha, FLA_Obj beta, FLA_Obj gamma)
 
FLA_Error FLA_Negate_check (FLA_Obj x)
 
FLA_Error FLA_Norm1_check (FLA_Obj A, FLA_Obj norm)
 
FLA_Error FLA_Norm_inf_check (FLA_Obj A, FLA_Obj norm)
 
FLA_Error FLA_Norm_frob_check (FLA_Obj A, FLA_Obj norm)
 
FLA_Error FLA_Pow_check (FLA_Obj base, FLA_Obj exp, FLA_Obj btoe)
 
FLA_Error FLA_Random_matrix_check (FLA_Obj A)
 
FLA_Error FLA_Random_herm_matrix_check (FLA_Uplo uplo, FLA_Obj A)
 
FLA_Error FLA_Random_symm_matrix_check (FLA_Uplo uplo, FLA_Obj A)
 
FLA_Error FLA_Random_spd_matrix_check (FLA_Uplo uplo, FLA_Obj A)
 
FLA_Error FLA_Random_tri_matrix_check (FLA_Uplo uplo, FLA_Diag diag, FLA_Obj A)
 
FLA_Error FLA_Random_unitary_matrix_check (FLA_Obj A)
 
FLA_Error FLA_Scal_elemwise_check (FLA_Trans trans, FLA_Obj A, FLA_Obj B)
 
FLA_Error FLA_Setr_check (FLA_Uplo uplo, FLA_Obj alpha, FLA_Obj A)
 
FLA_Error FLA_Sort_check (FLA_Direct direct, FLA_Obj x)
 
FLA_Error FLA_Sqrt_check (FLA_Obj alpha)
 
FLA_Error FLA_Symmetrize_check (FLA_Uplo uplo, FLA_Obj A)
 
FLA_Error FLA_Triangularize_check (FLA_Uplo uplo, FLA_Diag diag, FLA_Obj A)
 
FLA_Error FLA_Transpose_check (FLA_Obj A)
 
FLA_Error FLA_Set_check (FLA_Obj alpha, FLA_Obj A)
 
FLA_Error FLA_Set_diag_check (FLA_Obj alpha, FLA_Obj A)
 
FLA_Error FLA_Set_to_identity_check (FLA_Obj A)
 
FLA_Error FLA_Add_to_diag_check (void *diag_value, FLA_Obj A)
 
FLA_Error FLA_Shift_diag_check (FLA_Conj conj, FLA_Obj sigma, FLA_Obj A)
 
FLA_Error FLA_Scale_diag_check (FLA_Conj conj, FLA_Obj alpha, FLA_Obj A)
 
FLA_Error FLA_Transpose_blk_var1 (FLA_Obj A, fla_tpose_t *cntl)
 
FLA_Error FLA_Transpose_blk_var2 (FLA_Obj A, fla_tpose_t *cntl)
 
FLA_Error FLA_Transpose_unb_var1 (FLA_Obj A)
 
FLA_Error FLA_Transpose_unb_var2 (FLA_Obj A)
 
FLA_Error FLA_Swap_t_blk_var1 (FLA_Obj A, FLA_Obj B, fla_swap_t *cntl)
 
FLA_Error FLA_Swap_t_blk_var2 (FLA_Obj A, FLA_Obj B, fla_swap_t *cntl)
 
FLA_Error FLA_Sort (FLA_Direct direct, FLA_Obj x)
 
FLA_Error FLA_Sort_f_ops (int m_x, float *x, int inc_x)
 
FLA_Error FLA_Sort_b_ops (int m_x, float *x, int inc_x)
 
FLA_Error FLA_Sort_f_opd (int m_x, double *x, int inc_x)
 
FLA_Error FLA_Sort_b_opd (int m_x, double *x, int inc_x)
 

Function Documentation

◆ FLA_Absolute_square()

FLA_Error FLA_Absolute_square ( FLA_Obj  alpha)

References FLA_Absolute_square_check(), FLA_Check_error_level(), FLA_Obj_datatype(), scomplex::imag, dcomplex::imag, scomplex::real, and dcomplex::real.

Referenced by FLA_Ttmm_l_unb_var1(), FLA_Ttmm_l_unb_var2(), FLA_Ttmm_l_unb_var3(), FLA_Ttmm_u_unb_var1(), FLA_Ttmm_u_unb_var2(), and FLA_Ttmm_u_unb_var3().

14 {
15  FLA_Datatype datatype;
16 
17  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
19 
20  datatype = FLA_Obj_datatype( alpha );
21 
22  switch ( datatype ){
23 
24  case FLA_FLOAT:
25  {
26  float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
27 
28  *buff_alpha = (*buff_alpha) * (*buff_alpha);
29 
30  break;
31  }
32 
33  case FLA_DOUBLE:
34  {
35  double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
36 
37  *buff_alpha = (*buff_alpha) * (*buff_alpha);
38 
39  break;
40  }
41 
42  case FLA_COMPLEX:
43  {
44  scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha );
45 
46  buff_alpha->real = buff_alpha->real * buff_alpha->real +
47  buff_alpha->imag * buff_alpha->imag;
48  buff_alpha->imag = 0.0F;
49 
50  break;
51  }
52 
53  case FLA_DOUBLE_COMPLEX:
54  {
55  dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha );
56 
57  buff_alpha->real = buff_alpha->real * buff_alpha->real +
58  buff_alpha->imag * buff_alpha->imag;
59  buff_alpha->imag = 0.0;
60 
61  break;
62  }
63 
64  }
65 
66  return FLA_SUCCESS;
67 }
float real
Definition: blis_type_defs.h:134
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
Definition: blis_type_defs.h:132
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
FLA_Error FLA_Absolute_square_check(FLA_Obj alpha)
Definition: FLA_Absolute_square_check.c:13
float imag
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:137

◆ FLA_Absolute_square_check()

FLA_Error FLA_Absolute_square_check ( FLA_Obj  alpha)

References FLA_Check_floating_object(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().

Referenced by FLA_Absolute_square().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( alpha );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( alpha );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_if_scalar( alpha );
24  FLA_Check_error_code( e_val );
25 
26  return FLA_SUCCESS;
27 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373

◆ FLA_Absolute_value()

FLA_Error FLA_Absolute_value ( FLA_Obj  alpha)

References FLA_Absolute_value_check(), FLA_Check_error_level(), FLA_Obj_datatype(), scomplex::imag, dcomplex::imag, scomplex::real, and dcomplex::real.

Referenced by FLA_Bidiag_UT_l_realify_unb(), FLA_Bidiag_UT_u_realify_unb(), FLA_Tridiag_UT_l_realify_unb(), and FLA_Tridiag_UT_u_realify_unb().

14 {
15  FLA_Datatype datatype;
16 
17  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
18  FLA_Absolute_value_check( alpha );
19 
20  datatype = FLA_Obj_datatype( alpha );
21 
22  switch ( datatype ){
23 
24  case FLA_FLOAT:
25  {
26  float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
27 
28  *buff_alpha = ( float ) fabs( ( double ) *buff_alpha );
29 
30  break;
31  }
32 
33  case FLA_DOUBLE:
34  {
35  double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
36 
37  *buff_alpha = fabs( *buff_alpha );
38 
39  break;
40  }
41 
42  case FLA_COMPLEX:
43  {
44  scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha );
45 
46  buff_alpha->real = ( float ) sqrt( ( double ) buff_alpha->real * buff_alpha->real +
47  buff_alpha->imag * buff_alpha->imag );
48  buff_alpha->imag = 0.0F;
49 
50 
51  break;
52  }
53 
54  case FLA_DOUBLE_COMPLEX:
55  {
56  dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha );
57 
58  buff_alpha->real = sqrt( buff_alpha->real * buff_alpha->real +
59  buff_alpha->imag * buff_alpha->imag );
60  buff_alpha->imag = 0.0;
61 
62  break;
63  }
64 
65  }
66 
67  return FLA_SUCCESS;
68 }
float real
Definition: blis_type_defs.h:134
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
FLA_Error FLA_Absolute_value_check(FLA_Obj alpha)
Definition: FLA_Absolute_value_check.c:13
Definition: blis_type_defs.h:132
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
float imag
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:137

◆ FLA_Absolute_value_check()

FLA_Error FLA_Absolute_value_check ( FLA_Obj  alpha)

References FLA_Check_floating_object(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().

Referenced by FLA_Absolute_value().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( alpha );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( alpha );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_if_scalar( alpha );
24  FLA_Check_error_code( e_val );
25 
26  return FLA_SUCCESS;
27 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373

◆ FLA_Add_to_diag()

FLA_Error FLA_Add_to_diag ( void *  diag_value,
FLA_Obj  A 
)

References FLA_Add_to_diag_check(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_min_dim(), FLA_Obj_row_stride(), scomplex::imag, dcomplex::imag, scomplex::real, and dcomplex::real.

14 {
15  FLA_Datatype datatype;
16  dim_t j, min_m_n;
17  dim_t rs, cs;
18 
19  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
20  FLA_Add_to_diag_check( diag_value, A );
21 
22  datatype = FLA_Obj_datatype( A );
23  min_m_n = FLA_Obj_min_dim( A );
24  rs = FLA_Obj_row_stride( A );
25  cs = FLA_Obj_col_stride( A );
26 
27  switch ( datatype ){
28 
29  case FLA_FLOAT:
30  {
31  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
32  float *value_ptr = ( float * ) diag_value;
33 
34  for ( j = 0; j < min_m_n; j++ )
35  buff_A[ j*cs + j*rs ] += *value_ptr;
36 
37  break;
38  }
39 
40  case FLA_DOUBLE:
41  {
42  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
43  double *value_ptr = ( double * ) diag_value;
44 
45  for ( j = 0; j < min_m_n; j++ )
46  buff_A[ j*cs + j*rs ] += *value_ptr;
47 
48  break;
49  }
50 
51  case FLA_COMPLEX:
52  {
53  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
54  scomplex *value_ptr = ( scomplex * ) diag_value;
55 
56  for ( j = 0; j < min_m_n; j++ )
57  {
58  buff_A[ j*cs + j*rs ].real += value_ptr->real;
59  buff_A[ j*cs + j*rs ].imag += value_ptr->imag;
60  }
61 
62  break;
63  }
64 
65  case FLA_DOUBLE_COMPLEX:
66  {
67  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
68  dcomplex *value_ptr = ( dcomplex * ) diag_value;
69 
70  for ( j = 0; j < min_m_n; j++ )
71  {
72  buff_A[ j*cs + j*rs ].real += value_ptr->real;
73  buff_A[ j*cs + j*rs ].imag += value_ptr->imag;
74  }
75 
76  break;
77  }
78 
79  }
80 
81  return FLA_SUCCESS;
82 }
float real
Definition: blis_type_defs.h:134
unsigned long dim_t
Definition: FLA_type_defs.h:71
double imag
Definition: blis_type_defs.h:139
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
double real
Definition: blis_type_defs.h:139
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
Definition: blis_type_defs.h:132
FLA_Error FLA_Add_to_diag_check(void *diag_value, FLA_Obj A)
Definition: FLA_Add_to_diag_check.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
float imag
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:137
dim_t FLA_Obj_min_dim(FLA_Obj obj)
Definition: FLA_Query.c:153

◆ FLA_Add_to_diag_check()

FLA_Error FLA_Add_to_diag_check ( void *  diag_value,
FLA_Obj  A 
)

References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), and FLA_Check_null_pointer().

Referenced by FLA_Add_to_diag().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( A );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_null_pointer( diag_value );
24  FLA_Check_error_code( e_val );
25 
26  return FLA_SUCCESS;
27 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_null_pointer(void *ptr)
Definition: FLA_Check.c:518

◆ FLA_Clock()

double FLA_Clock ( void  )

References detect_clocks(), and FLA_Clock_helper().

Referenced by FLASH_Queue_exec().

21 {
22  return FLA_Clock_helper();
23 }
double FLA_Clock_helper(void)
Definition: FLA_Clock.c:40

◆ FLA_Conjugate()

FLA_Error FLA_Conjugate ( FLA_Obj  A)

References bl1_cconjm(), bl1_zconjm(), FLA_Check_error_level(), FLA_Conjugate_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_is_real(), FLA_Obj_length(), FLA_Obj_row_stride(), and FLA_Obj_width().

Referenced by FLA_Bidiag_UT_internal(), FLA_Bidiag_UT_u_step_unb_var3(), FLA_Bidiag_UT_u_step_unb_var4(), FLA_LQ_UT_form_Q(), FLA_Svd(), FLA_Svd_ext(), and FLA_Svd_ext_u_unb_var1().

14 {
15  FLA_Datatype datatype;
16  int m_A, n_A;
17  int rs_A, cs_A;
18 
19  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
21 
22  if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS;
23 
24  if ( FLA_Obj_is_real( A ) ) return FLA_SUCCESS;
25 
26  datatype = FLA_Obj_datatype( A );
27 
28  m_A = FLA_Obj_length( A );
29  n_A = FLA_Obj_width( A );
30  rs_A = FLA_Obj_row_stride( A );
31  cs_A = FLA_Obj_col_stride( A );
32 
33 
34  switch ( datatype ){
35 
36  case FLA_COMPLEX:
37  {
38  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
39 
40  bl1_cconjm( m_A,
41  n_A,
42  buff_A, rs_A, cs_A );
43 
44  break;
45  }
46 
47  case FLA_DOUBLE_COMPLEX:
48  {
49  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
50 
51  bl1_zconjm( m_A,
52  n_A,
53  buff_A, rs_A, cs_A );
54 
55  break;
56  }
57 
58  }
59 
60  return FLA_SUCCESS;
61 }
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
void bl1_cconjm(int m, int n, scomplex *a, int a_rs, int a_cs)
Definition: bl1_conjm.c:23
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition: FLA_Query.c:400
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
Definition: blis_type_defs.h:132
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
FLA_Error FLA_Conjugate_check(FLA_Obj A)
Definition: FLA_Conjugate_check.c:13
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
void bl1_zconjm(int m, int n, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_conjm.c:72
FLA_Bool FLA_Obj_is_real(FLA_Obj A)
Definition: FLA_Query.c:307
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
Definition: blis_type_defs.h:137

◆ FLA_Conjugate_check()

FLA_Error FLA_Conjugate_check ( FLA_Obj  A)

References FLA_Check_floating_object(), and FLA_Check_nonconstant_object().

Referenced by FLA_Conjugate().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( A );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( A );
21  FLA_Check_error_code( e_val );
22 
23  return FLA_SUCCESS;
24 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232

◆ FLA_Conjugate_r()

FLA_Error FLA_Conjugate_r ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References bl1_cconjmr(), bl1_zconjmr(), FLA_Check_error_level(), FLA_Conjugate_r_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_is_real(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Param_map_flame_to_blis_uplo().

Referenced by FLA_Bidiag_UT_internal().

14 {
15  FLA_Datatype datatype;
16  int m_A, n_A;
17  int rs_A, cs_A;
18  uplo1_t blis_uplo;
19 
20  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
21  FLA_Conjugate_r_check( uplo, A );
22 
23  if ( FLA_Obj_is_real( A ) ) return FLA_SUCCESS;
24 
25  datatype = FLA_Obj_datatype( A );
26 
27  m_A = FLA_Obj_length( A );
28  n_A = FLA_Obj_width( A );
29  rs_A = FLA_Obj_row_stride( A );
30  cs_A = FLA_Obj_col_stride( A );
31 
32  FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo );
33 
34  switch ( datatype ){
35 
36  case FLA_COMPLEX:
37  {
38  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
39 
40  bl1_cconjmr( blis_uplo,
41  m_A,
42  n_A,
43  buff_A, rs_A, cs_A );
44 
45  break;
46  }
47 
48  case FLA_DOUBLE_COMPLEX:
49  {
50  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
51 
52  bl1_zconjmr( blis_uplo,
53  m_A,
54  n_A,
55  buff_A, rs_A, cs_A );
56 
57  break;
58  }
59 
60  }
61 
62  return FLA_SUCCESS;
63 }
uplo1_t
Definition: blis_type_defs.h:60
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void bl1_cconjmr(uplo1_t uplo, int m, int n, scomplex *a, int a_rs, int a_cs)
Definition: bl1_conjmr.c:23
void FLA_Param_map_flame_to_blis_uplo(FLA_Uplo uplo, uplo1_t *blis_uplo)
Definition: FLA_Param.c:285
Definition: blis_type_defs.h:132
FLA_Error FLA_Conjugate_r_check(FLA_Uplo uplo, FLA_Obj A)
Definition: FLA_Conjugate_r_check.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
void bl1_zconjmr(uplo1_t uplo, int m, int n, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_conjmr.c:79
FLA_Bool FLA_Obj_is_real(FLA_Obj A)
Definition: FLA_Query.c:307
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
Definition: blis_type_defs.h:137

◆ FLA_Conjugate_r_check()

FLA_Error FLA_Conjugate_r_check ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), and FLA_Check_valid_uplo().

Referenced by FLA_Conjugate_r().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_uplo( uplo );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( A );
24  FLA_Check_error_code( e_val );
25 
26  return FLA_SUCCESS;
27 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_valid_uplo(FLA_Uplo uplo)
Definition: FLA_Check.c:76

◆ FLA_Fill_with_cluster_dist()

FLA_Error FLA_Fill_with_cluster_dist ( FLA_Obj  n_clusters,
FLA_Obj  cluster_width,
FLA_Obj  x 
)

References FLA_Check_error_level(), FLA_Cont_with_3x1_to_2x1(), FLA_Copy(), FLA_Fill_with_cluster_dist_check(), FLA_Fill_with_linear_dist(), FLA_Fill_with_random_dist(), FLA_Mult_add(), FLA_Obj_create(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_free(), FLA_Obj_length(), FLA_Obj_vector_dim(), FLA_ONE, FLA_Part_2x1(), FLA_Repart_2x1_to_3x1(), FLA_Set(), FLA_Sort(), and FLA_ZERO.

14 {
15  FLA_Obj lT, l0,
16  lB, l1,
17  l2;
18  FLA_Obj lT_rest,
19  lT_last;
20  FLA_Obj l, k;
21  FLA_Datatype dt_real;
22  dim_t n_x;
23  int nc;
24  int n_regions;
25  int region_width;
26  int leftover_width;
27 
28 
29  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
30  FLA_Fill_with_cluster_dist_check( n_clusters, cluster_width, x );
31 
32  dt_real = FLA_Obj_datatype_proj_to_real( x );
33  n_x = FLA_Obj_vector_dim( x );
34 
35  nc = *FLA_INT_PTR( n_clusters );
36  n_regions = 2 * nc;
37  region_width = n_x / n_regions;
38  leftover_width = n_x % n_regions;
39 
40  // Create a local counter to increment as we create the distribution.
41  FLA_Obj_create( dt_real, 1, 1, 0, 0, &k );
42 
43  // Create a local vector l. We will work with this vector, which is
44  // the same length as x, so that we can use vertical partitioning.
45  FLA_Obj_create( dt_real, n_x, 1, 0, 0, &l );
46 
47  // Initialize k to 1.
48  FLA_Set( FLA_ZERO, k );
49 
50  FLA_Part_2x1( l, &lT,
51  &lB, 0, FLA_TOP );
52 
53  while ( FLA_Obj_length( lT ) < n_regions * region_width )
54  {
55  FLA_Repart_2x1_to_3x1( lT, &l0,
56  /* ** */ /* ******* */
57  &l1,
58  lB, &l2, region_width, FLA_BOTTOM );
59 
60  /*------------------------------------------------------------*/
61 
63 
64  /*------------------------------------------------------------*/
65 
66  FLA_Cont_with_3x1_to_2x1( &lT, l0,
67  l1,
68  /* ** */ /* ******* */
69  &lB, l2, FLA_TOP );
70 
71 
72  FLA_Part_2x1( lT, &lT_rest,
73  &lT_last, 1, FLA_BOTTOM );
74  FLA_Copy( lT_last, k );
75 
76 
77  FLA_Repart_2x1_to_3x1( lT, &l0,
78  /* ** */ /* ******* */
79  &l1,
80  lB, &l2, region_width, FLA_BOTTOM );
81 
82  /*------------------------------------------------------------*/
83 
84  FLA_Fill_with_random_dist( k, cluster_width, l1 );
85  FLA_Sort( FLA_FORWARD, l1 );
86 
87  /*------------------------------------------------------------*/
88 
89  FLA_Cont_with_3x1_to_2x1( &lT, l0,
90  l1,
91  /* ** */ /* ******* */
92  &lB, l2, FLA_TOP );
93 
94  FLA_Part_2x1( lT, &lT_rest,
95  &lT_last, 1, FLA_BOTTOM );
96  FLA_Copy( lT_last, k );
98  }
99 
100  if ( leftover_width > 0 )
102 
103  // Normalize by last element.
104  //FLA_Part_2x1( l, &lT,
105  // &lB, 1, FLA_BOTTOM );
106  //FLA_Inv_scal( lB, l );
107 
108  // Overwrite x with the distribution we created in l.
109  FLA_Copy( l, x );
110 
111  FLA_Obj_free( &l );
112  FLA_Obj_free( &k );
113 
114  return FLA_SUCCESS;
115 }
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_Error FLA_Repart_2x1_to_3x1(FLA_Obj AT, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj AB, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:226
unsigned long dim_t
Definition: FLA_type_defs.h:71
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition: FLA_Obj.c:588
FLA_Error FLA_Copy(FLA_Obj A, FLA_Obj B)
Definition: FLA_Copy.c:15
FLA_Error FLA_Cont_with_3x1_to_2x1(FLA_Obj *AT, FLA_Obj A0, FLA_Obj A1, FLA_Obj *AB, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:428
FLA_Error FLA_Fill_with_cluster_dist_check(FLA_Obj n_clusters, FLA_Obj cluster_width, FLA_Obj x)
Definition: FLA_Fill_with_cluster_dist_check.c:13
FLA_Error FLA_Fill_with_random_dist(FLA_Obj shift, FLA_Obj max, FLA_Obj x)
Definition: FLA_Fill_with_random_dist.c:13
FLA_Obj FLA_ONE
Definition: FLA_Init.c:18
FLA_Error FLA_Fill_with_linear_dist(FLA_Obj shift, FLA_Obj delta, FLA_Obj x)
Definition: FLA_Fill_with_linear_dist.c:13
Definition: FLA_type_defs.h:158
FLA_Error FLA_Set(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Set.c:13
FLA_Datatype FLA_Obj_datatype_proj_to_real(FLA_Obj A)
Definition: FLA_Query.c:23
FLA_Error FLA_Part_2x1(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:76
dim_t FLA_Obj_vector_dim(FLA_Obj obj)
Definition: FLA_Query.c:137
FLA_Error FLA_Mult_add(FLA_Obj alpha, FLA_Obj beta, FLA_Obj gamma)
Definition: FLA_Mult_add.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
FLA_Error FLA_Sort(FLA_Direct direct, FLA_Obj x)
Definition: FLA_Sort.c:18
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
FLA_Obj FLA_ZERO
Definition: FLA_Init.c:20

◆ FLA_Fill_with_cluster_dist_check()

FLA_Error FLA_Fill_with_cluster_dist_check ( FLA_Obj  n_clusters,
FLA_Obj  cluster_width,
FLA_Obj  x 
)

References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_if_vector(), FLA_Check_int_object(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().

Referenced by FLA_Fill_with_cluster_dist().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( x );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( x );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_int_object( n_clusters );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_real_object( cluster_width );
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_identical_object_precision( cluster_width, x );
30  FLA_Check_error_code( e_val );
31 
32  e_val = FLA_Check_if_scalar( n_clusters );
33  FLA_Check_error_code( e_val );
34 
35  e_val = FLA_Check_if_scalar( cluster_width );
36  FLA_Check_error_code( e_val );
37 
38  e_val = FLA_Check_if_vector( x );
39  FLA_Check_error_code( e_val );
40 
41  return FLA_SUCCESS;
42 }
FLA_Error FLA_Check_int_object(FLA_Obj A)
Definition: FLA_Check.c:245
FLA_Error FLA_Check_if_vector(FLA_Obj A)
Definition: FLA_Check.c:383
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:298
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_real_object(FLA_Obj A)
Definition: FLA_Check.c:258
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373

◆ FLA_Fill_with_geometric_dist()

FLA_Error FLA_Fill_with_geometric_dist ( FLA_Obj  alpha,
FLA_Obj  x 
)

References alpha2, FLA_Check_error_level(), FLA_Cont_with_3x1_to_2x1(), FLA_Copy(), FLA_Fill_with_geometric_dist_check(), FLA_MINUS_ONE, FLA_Mult_add(), FLA_Obj_create(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_free(), FLA_Obj_length(), FLA_Obj_vector_dim(), FLA_ONE, FLA_Part_2x1(), FLA_Pow(), FLA_Repart_2x1_to_3x1(), FLA_Scal(), FLA_Set(), FLA_ZERO, and temp.

14 {
15  FLA_Obj lT, l0,
16  lB, lambda1,
17  l2;
18  FLA_Obj l, k, alpha2, temp;
19  FLA_Datatype dt_real;
20  dim_t n_x;
21 
22 
23  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
25 
26  dt_real = FLA_Obj_datatype_proj_to_real( x );
27  n_x = FLA_Obj_vector_dim( x );
28 
29  // Create a local counter to increment as we create the distribution.
30  FLA_Obj_create( dt_real, 1, 1, 0, 0, &k );
31 
32  // Create a local vector l. We will work with this vector, which is
33  // the same length as x, so that we can use vertical partitioning.
34  FLA_Obj_create( dt_real, n_x, 1, 0, 0, &l );
35 
36  // Create a local real scalar alpha2 of the same precision as
37  // alpha. Then copy alpha to alpha2, which will convert the
38  // complex value to real, if necessary (ie: if alpha is complex).
39  FLA_Obj_create( dt_real, 1, 1, 0, 0, &alpha2 );
40  FLA_Copy( alpha, alpha2 );
41 
42  // Create a temporary scalar.
43  FLA_Obj_create( dt_real, 1, 1, 0, 0, &temp );
44 
45  // Initialize k to 0.
46  FLA_Set( FLA_ZERO, k );
47 
48  FLA_Part_2x1( l, &lT,
49  &lB, 0, FLA_TOP );
50 
51  while ( FLA_Obj_length( lB ) > 0 )
52  {
53  FLA_Repart_2x1_to_3x1( lT, &l0,
54  /* ** */ /* ******* */
55  &lambda1,
56  lB, &l2, 1, FLA_BOTTOM );
57 
58  /*------------------------------------------------------------*/
59 
60  // lambda1 = alpha * (1 - alpha)^k;
61  FLA_Set( FLA_ONE, temp );
62  FLA_Mult_add( FLA_MINUS_ONE, alpha2, temp );
63  FLA_Pow( temp, k, lambda1 );
64  FLA_Scal( alpha2, lambda1 );
65 
66  // k = k + 1;
68 
69  /*------------------------------------------------------------*/
70 
71  FLA_Cont_with_3x1_to_2x1( &lT, l0,
72  lambda1,
73  /* ** */ /* ******* */
74  &lB, l2, FLA_TOP );
75  }
76 
77  // Normalize by first element.
78  //FLA_Part_2x1( l, &lT,
79  // &lB, 1, FLA_TOP );
80  //FLA_Inv_scal( lT, l );
81 
82  // Overwrite x with the distribution we created in l.
83  // If x is complex, then this is where the conversion between
84  // datatypes happens.
85  FLA_Copy( l, x );
86 
87  FLA_Obj_free( &l );
88  FLA_Obj_free( &k );
89  FLA_Obj_free( &alpha2 );
90  FLA_Obj_free( &temp );
91 
92  return FLA_SUCCESS;
93 }
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_Error FLA_Repart_2x1_to_3x1(FLA_Obj AT, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj AB, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:226
unsigned long dim_t
Definition: FLA_type_defs.h:71
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition: FLA_Obj.c:588
FLA_Obj FLA_MINUS_ONE
Definition: FLA_Init.c:22
FLA_Error FLA_Copy(FLA_Obj A, FLA_Obj B)
Definition: FLA_Copy.c:15
dcomplex temp
Definition: bl1_axpyv2b.c:301
FLA_Error FLA_Fill_with_geometric_dist_check(FLA_Obj alpha, FLA_Obj x)
Definition: FLA_Fill_with_geometric_dist_check.c:13
FLA_Error FLA_Cont_with_3x1_to_2x1(FLA_Obj *AT, FLA_Obj A0, FLA_Obj A1, FLA_Obj *AB, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:428
double *restrict alpha2
Definition: bl1_dotv2axpyv2b.c:186
FLA_Obj FLA_ONE
Definition: FLA_Init.c:18
Definition: FLA_type_defs.h:158
FLA_Error FLA_Set(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Set.c:13
FLA_Error FLA_Scal(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Scal.c:15
FLA_Datatype FLA_Obj_datatype_proj_to_real(FLA_Obj A)
Definition: FLA_Query.c:23
FLA_Error FLA_Pow(FLA_Obj base, FLA_Obj exp, FLA_Obj btoe)
Definition: FLA_Pow.c:13
FLA_Error FLA_Part_2x1(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:76
dim_t FLA_Obj_vector_dim(FLA_Obj obj)
Definition: FLA_Query.c:137
FLA_Error FLA_Mult_add(FLA_Obj alpha, FLA_Obj beta, FLA_Obj gamma)
Definition: FLA_Mult_add.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
FLA_Obj FLA_ZERO
Definition: FLA_Init.c:20

◆ FLA_Fill_with_geometric_dist_check()

FLA_Error FLA_Fill_with_geometric_dist_check ( FLA_Obj  alpha,
FLA_Obj  x 
)

References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_if_vector(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().

Referenced by FLA_Fill_with_geometric_dist().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( x );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( x );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_real_object( alpha );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_identical_object_precision( x, alpha );
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_if_scalar( alpha );
30  FLA_Check_error_code( e_val );
31 
32  e_val = FLA_Check_if_vector( x );
33  FLA_Check_error_code( e_val );
34 
35  return FLA_SUCCESS;
36 }
FLA_Error FLA_Check_if_vector(FLA_Obj A)
Definition: FLA_Check.c:383
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:298
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_real_object(FLA_Obj A)
Definition: FLA_Check.c:258
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373

◆ FLA_Fill_with_inverse_dist()

FLA_Error FLA_Fill_with_inverse_dist ( FLA_Obj  alpha,
FLA_Obj  x 
)

References alpha2, FLA_Check_error_level(), FLA_Cont_with_3x1_to_2x1(), FLA_Copy(), FLA_Fill_with_inverse_dist_check(), FLA_Inv_scal(), FLA_Invert(), FLA_Mult_add(), FLA_Obj_create(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_free(), FLA_Obj_length(), FLA_Obj_vector_dim(), FLA_ONE, FLA_Part_2x1(), FLA_Repart_2x1_to_3x1(), and FLA_Set().

14 {
15  FLA_Obj lT, l0,
16  lB, lambda1,
17  l2;
18  FLA_Obj l, k, alpha2;
19  FLA_Datatype dt_real;
20  dim_t n_x;
21 
22 
23  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
25 
26  dt_real = FLA_Obj_datatype_proj_to_real( x );
27  n_x = FLA_Obj_vector_dim( x );
28 
29  // Create a local counter to increment as we create the distribution.
30  FLA_Obj_create( dt_real, 1, 1, 0, 0, &k );
31 
32  // Create a local vector l. We will work with this vector, which is
33  // the same length as x, so that we can use vertical partitioning.
34  FLA_Obj_create( dt_real, n_x, 1, 0, 0, &l );
35 
36  // Create a local real scalar alpha2 of the same precision as
37  // alpha. Then copy alpha to alpha2, which will convert the
38  // complex value to real, if necessary (ie: if alpha is complex).
39  FLA_Obj_create( dt_real, 1, 1, 0, 0, &alpha2 );
40  FLA_Copy( alpha, alpha2 );
41 
42  // Initialize k to 1.
43  FLA_Set( FLA_ONE, k );
44 
45  FLA_Part_2x1( l, &lT,
46  &lB, 0, FLA_TOP );
47 
48  while ( FLA_Obj_length( lB ) > 0 )
49  {
50  FLA_Repart_2x1_to_3x1( lT, &l0,
51  /* ** */ /* ******* */
52  &lambda1,
53  lB, &l2, 1, FLA_BOTTOM );
54 
55  /*------------------------------------------------------------*/
56 
57  // lambda1 = alpha2 / k;
58  FLA_Copy( k, lambda1 );
59  FLA_Inv_scal( alpha2, lambda1 );
60  FLA_Invert( FLA_NO_CONJUGATE, lambda1 );
61 
62  // k = k + 1;
64 
65  /*------------------------------------------------------------*/
66 
67  FLA_Cont_with_3x1_to_2x1( &lT, l0,
68  lambda1,
69  /* ** */ /* ******* */
70  &lB, l2, FLA_TOP );
71  }
72 
73  // Overwrite x with the distribution we created in l.
74  // If x is complex, then this is where the conversion between
75  // datatypes happens.
76  FLA_Copy( l, x );
77 
78  FLA_Obj_free( &l );
79  FLA_Obj_free( &k );
80  FLA_Obj_free( &alpha2 );
81 
82  return FLA_SUCCESS;
83 }
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_Error FLA_Repart_2x1_to_3x1(FLA_Obj AT, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj AB, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:226
unsigned long dim_t
Definition: FLA_type_defs.h:71
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition: FLA_Obj.c:588
FLA_Error FLA_Copy(FLA_Obj A, FLA_Obj B)
Definition: FLA_Copy.c:15
FLA_Error FLA_Cont_with_3x1_to_2x1(FLA_Obj *AT, FLA_Obj A0, FLA_Obj A1, FLA_Obj *AB, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:428
double *restrict alpha2
Definition: bl1_dotv2axpyv2b.c:186
FLA_Obj FLA_ONE
Definition: FLA_Init.c:18
Definition: FLA_type_defs.h:158
FLA_Error FLA_Set(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Set.c:13
FLA_Error FLA_Invert(FLA_Conj conj, FLA_Obj x)
Definition: FLA_Invert.c:13
FLA_Datatype FLA_Obj_datatype_proj_to_real(FLA_Obj A)
Definition: FLA_Query.c:23
FLA_Error FLA_Inv_scal(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Inv_scal.c:13
FLA_Error FLA_Fill_with_inverse_dist_check(FLA_Obj alpha, FLA_Obj x)
Definition: FLA_Fill_with_inverse_dist_check.c:13
FLA_Error FLA_Part_2x1(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:76
dim_t FLA_Obj_vector_dim(FLA_Obj obj)
Definition: FLA_Query.c:137
FLA_Error FLA_Mult_add(FLA_Obj alpha, FLA_Obj beta, FLA_Obj gamma)
Definition: FLA_Mult_add.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116

◆ FLA_Fill_with_inverse_dist_check()

FLA_Error FLA_Fill_with_inverse_dist_check ( FLA_Obj  alpha,
FLA_Obj  x 
)

References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_if_vector(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().

Referenced by FLA_Fill_with_inverse_dist().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( x );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( x );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_real_object( alpha );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_identical_object_precision( x, alpha );
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_if_scalar( alpha );
30  FLA_Check_error_code( e_val );
31 
32  e_val = FLA_Check_if_vector( x );
33  FLA_Check_error_code( e_val );
34 
35  return FLA_SUCCESS;
36 }
FLA_Error FLA_Check_if_vector(FLA_Obj A)
Definition: FLA_Check.c:383
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:298
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_real_object(FLA_Obj A)
Definition: FLA_Check.c:258
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373

◆ FLA_Fill_with_linear_dist()

FLA_Error FLA_Fill_with_linear_dist ( FLA_Obj  shift,
FLA_Obj  delta,
FLA_Obj  x 
)

References FLA_Check_error_level(), FLA_Cont_with_3x1_to_2x1(), FLA_Copy(), FLA_Fill_with_linear_dist_check(), FLA_Mult_add(), FLA_Obj_create(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_free(), FLA_Obj_length(), FLA_Obj_vector_dim(), FLA_ONE, FLA_Part_2x1(), FLA_Repart_2x1_to_3x1(), and FLA_Set().

Referenced by FLA_Fill_with_cluster_dist().

14 {
15  FLA_Obj lT, l0,
16  lB, lambda1,
17  l2;
18  FLA_Obj l, k, delta2;
19  FLA_Datatype dt_real;
20  dim_t n_x;
21 
22 
23  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
24  FLA_Fill_with_linear_dist_check( shift, delta, x );
25 
26  dt_real = FLA_Obj_datatype_proj_to_real( x );
27  n_x = FLA_Obj_vector_dim( x );
28 
29  // Create a local counter to increment as we create the distribution.
30  FLA_Obj_create( dt_real, 1, 1, 0, 0, &k );
31 
32  // Create a local vector l. We will work with this vector, which is
33  // the same length as x, so that we can use vertical partitioning.
34  FLA_Obj_create( dt_real, n_x, 1, 0, 0, &l );
35 
36  // Create a local real scalar alpha2 of the same precision as
37  // alpha. Then copy alpha to alpha2, which will convert the
38  // complex value to real, if necessary (ie: if alpha is complex).
39  FLA_Obj_create( dt_real, 1, 1, 0, 0, &delta2 );
40  FLA_Copy( delta, delta2 );
41 
42  // Initialize k to shift + delta2.
43  FLA_Set( shift, k );
44  FLA_Mult_add( FLA_ONE, delta2, k );
45 
46  FLA_Part_2x1( l, &lT,
47  &lB, 0, FLA_TOP );
48 
49  while ( FLA_Obj_length( lB ) > 0 )
50  {
51  FLA_Repart_2x1_to_3x1( lT, &l0,
52  /* ** */ /* ******* */
53  &lambda1,
54  lB, &l2, 1, FLA_BOTTOM );
55 
56  /*------------------------------------------------------------*/
57 
58  // lambda1 = k;
59  FLA_Copy( k, lambda1 );
60 
61  // k = k + delta2;
62  FLA_Mult_add( FLA_ONE, delta2, k );
63 
64  /*------------------------------------------------------------*/
65 
66  FLA_Cont_with_3x1_to_2x1( &lT, l0,
67  lambda1,
68  /* ** */ /* ******* */
69  &lB, l2, FLA_TOP );
70  }
71 
72  // Normalize by last element.
73  //FLA_Part_2x1( l, &lT,
74  // &lB, 1, FLA_BOTTOM );
75  //FLA_Inv_scal( lB, l );
76 
77  // Overwrite x with the distribution we created in l.
78  // If x is complex, then this is where the conversion between
79  // datatypes happens.
80  FLA_Copy( l, x );
81 
82  FLA_Obj_free( &l );
83  FLA_Obj_free( &k );
84  FLA_Obj_free( &delta2 );
85 
86  return FLA_SUCCESS;
87 }
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_Error FLA_Repart_2x1_to_3x1(FLA_Obj AT, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj AB, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:226
unsigned long dim_t
Definition: FLA_type_defs.h:71
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition: FLA_Obj.c:588
FLA_Error FLA_Copy(FLA_Obj A, FLA_Obj B)
Definition: FLA_Copy.c:15
FLA_Error FLA_Fill_with_linear_dist_check(FLA_Obj shift, FLA_Obj delta, FLA_Obj x)
Definition: FLA_Fill_with_linear_dist_check.c:13
FLA_Error FLA_Cont_with_3x1_to_2x1(FLA_Obj *AT, FLA_Obj A0, FLA_Obj A1, FLA_Obj *AB, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:428
FLA_Obj FLA_ONE
Definition: FLA_Init.c:18
Definition: FLA_type_defs.h:158
FLA_Error FLA_Set(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Set.c:13
FLA_Datatype FLA_Obj_datatype_proj_to_real(FLA_Obj A)
Definition: FLA_Query.c:23
FLA_Error FLA_Part_2x1(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:76
dim_t FLA_Obj_vector_dim(FLA_Obj obj)
Definition: FLA_Query.c:137
FLA_Error FLA_Mult_add(FLA_Obj alpha, FLA_Obj beta, FLA_Obj gamma)
Definition: FLA_Mult_add.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116

◆ FLA_Fill_with_linear_dist_check()

FLA_Error FLA_Fill_with_linear_dist_check ( FLA_Obj  shift,
FLA_Obj  delta,
FLA_Obj  x 
)

References FLA_Check_consistent_object_datatype(), FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_if_vector(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().

Referenced by FLA_Fill_with_linear_dist().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( x );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( x );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_real_object( shift );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_consistent_object_datatype( shift, delta );
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_identical_object_precision( x, delta );
30  FLA_Check_error_code( e_val );
31 
32  e_val = FLA_Check_if_scalar( shift );
33  FLA_Check_error_code( e_val );
34 
35  e_val = FLA_Check_if_scalar( delta );
36  FLA_Check_error_code( e_val );
37 
38  e_val = FLA_Check_if_vector( x );
39  FLA_Check_error_code( e_val );
40 
41  return FLA_SUCCESS;
42 }
FLA_Error FLA_Check_if_vector(FLA_Obj A)
Definition: FLA_Check.c:383
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:298
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_real_object(FLA_Obj A)
Definition: FLA_Check.c:258
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373
FLA_Error FLA_Check_consistent_object_datatype(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:339

◆ FLA_Fill_with_logarithmic_dist()

FLA_Error FLA_Fill_with_logarithmic_dist ( FLA_Obj  max,
FLA_Obj  x 
)

References alpha2, FLA_Check_error_level(), FLA_Cont_with_3x1_to_2x1(), FLA_Copy(), FLA_Fill_with_logarithmic_dist_check(), FLA_Inv_scal(), FLA_Mult_add(), FLA_Obj_create(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_free(), FLA_Obj_length(), FLA_Obj_vector_dim(), FLA_ONE, FLA_Part_2x1(), FLA_Pow(), FLA_Repart_2x1_to_3x1(), FLA_Set(), and FLA_ZERO.

14 {
15  FLA_Obj lT, l0,
16  lB, lambda1,
17  l2;
18  FLA_Obj l, k, alpha2;
19  FLA_Datatype dt_real;
20  dim_t n_x;
21 
22 
23  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
25 
26  dt_real = FLA_Obj_datatype_proj_to_real( x );
27  n_x = FLA_Obj_vector_dim( x );
28 
29  // Create a local counter to increment as we create the distribution.
30  FLA_Obj_create( dt_real, 1, 1, 0, 0, &k );
31 
32  // Create a local vector l. We will work with this vector, which is
33  // the same length as x, so that we can use vertical partitioning.
34  FLA_Obj_create( dt_real, n_x, 1, 0, 0, &l );
35 
36  // Create a local real scalar alpha2 of the same precision as
37  // alpha. Then copy alpha to alpha2, which will convert the
38  // complex value to real, if necessary (ie: if alpha is complex).
39  FLA_Obj_create( dt_real, 1, 1, 0, 0, &alpha2 );
40  FLA_Copy( alpha, alpha2 );
41 
42  // Initialize k to 0.
43  FLA_Set( FLA_ZERO, k );
44 
45  FLA_Part_2x1( l, &lT,
46  &lB, 0, FLA_TOP );
47 
48  while ( FLA_Obj_length( lB ) > 0 )
49  {
50  FLA_Repart_2x1_to_3x1( lT, &l0,
51  /* ** */ /* ******* */
52  &lambda1,
53  lB, &l2, 1, FLA_BOTTOM );
54 
55  /*------------------------------------------------------------*/
56 
57  // lambda1 = alpha^k;
58  FLA_Pow( alpha2, k, lambda1 );
59 
60  // k = k + 1;
62 
63  /*------------------------------------------------------------*/
64 
65  FLA_Cont_with_3x1_to_2x1( &lT, l0,
66  lambda1,
67  /* ** */ /* ******* */
68  &lB, l2, FLA_TOP );
69  }
70 
71  // Normalize by last element.
72  FLA_Part_2x1( l, &lT,
73  &lB, 1, FLA_BOTTOM );
74  FLA_Inv_scal( lB, l );
75 
76  // Overwrite x with the distribution we created in l.
77  FLA_Copy( l, x );
78 
79  FLA_Obj_free( &l );
80  FLA_Obj_free( &k );
81  FLA_Obj_free( &alpha2 );
82 
83  return FLA_SUCCESS;
84 }
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_Error FLA_Repart_2x1_to_3x1(FLA_Obj AT, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj AB, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:226
unsigned long dim_t
Definition: FLA_type_defs.h:71
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition: FLA_Obj.c:588
FLA_Error FLA_Copy(FLA_Obj A, FLA_Obj B)
Definition: FLA_Copy.c:15
FLA_Error FLA_Cont_with_3x1_to_2x1(FLA_Obj *AT, FLA_Obj A0, FLA_Obj A1, FLA_Obj *AB, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:428
double *restrict alpha2
Definition: bl1_dotv2axpyv2b.c:186
FLA_Obj FLA_ONE
Definition: FLA_Init.c:18
Definition: FLA_type_defs.h:158
FLA_Error FLA_Set(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Set.c:13
FLA_Datatype FLA_Obj_datatype_proj_to_real(FLA_Obj A)
Definition: FLA_Query.c:23
FLA_Error FLA_Inv_scal(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Inv_scal.c:13
FLA_Error FLA_Pow(FLA_Obj base, FLA_Obj exp, FLA_Obj btoe)
Definition: FLA_Pow.c:13
FLA_Error FLA_Part_2x1(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:76
dim_t FLA_Obj_vector_dim(FLA_Obj obj)
Definition: FLA_Query.c:137
FLA_Error FLA_Mult_add(FLA_Obj alpha, FLA_Obj beta, FLA_Obj gamma)
Definition: FLA_Mult_add.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
FLA_Error FLA_Fill_with_logarithmic_dist_check(FLA_Obj alpha, FLA_Obj x)
Definition: FLA_Fill_with_logarithmic_dist_check.c:13
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
FLA_Obj FLA_ZERO
Definition: FLA_Init.c:20

◆ FLA_Fill_with_logarithmic_dist_check()

FLA_Error FLA_Fill_with_logarithmic_dist_check ( FLA_Obj  alpha,
FLA_Obj  x 
)

References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_if_vector(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().

Referenced by FLA_Fill_with_logarithmic_dist().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( x );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( x );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_real_object( alpha );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_identical_object_precision( x, alpha );
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_if_scalar( alpha );
30  FLA_Check_error_code( e_val );
31 
32  e_val = FLA_Check_if_vector( x );
33  FLA_Check_error_code( e_val );
34 
35  return FLA_SUCCESS;
36 }
FLA_Error FLA_Check_if_vector(FLA_Obj A)
Definition: FLA_Check.c:383
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:298
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_real_object(FLA_Obj A)
Definition: FLA_Check.c:258
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373

◆ FLA_Fill_with_random_dist()

FLA_Error FLA_Fill_with_random_dist ( FLA_Obj  shift,
FLA_Obj  max,
FLA_Obj  x 
)

References FLA_Axpy(), FLA_Check_error_level(), FLA_Copy(), FLA_Fill_with_random_dist_check(), FLA_Obj_create(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_free(), FLA_Obj_vector_dim(), FLA_ONE, FLA_ONE_HALF, FLA_Random_matrix(), FLA_Scal(), and FLA_Set().

Referenced by FLA_Fill_with_cluster_dist().

14 {
15  FLA_Obj r, y;
16  FLA_Datatype dt_real;
17  dim_t n_x;
18 
19  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
20  FLA_Fill_with_random_dist_check( shift, max, x );
21 
22  dt_real = FLA_Obj_datatype_proj_to_real( x );
23  n_x = FLA_Obj_vector_dim( x );
24 
25  FLA_Obj_create( dt_real, n_x, 1, 0, 0, &r );
26  FLA_Obj_create( dt_real, n_x, 1, 0, 0, &y );
27 
28  FLA_Random_matrix( r );
29 
30  FLA_Set( FLA_ONE, y );
31  FLA_Axpy( FLA_ONE, r, y );
32  FLA_Scal( FLA_ONE_HALF, y );
33  FLA_Scal( max, y );
34 
35  FLA_Set( shift, r );
36  FLA_Axpy( FLA_ONE, y, r );
37 
38  // Overwrite x with the distribution we created in l.
39  // If x is complex, then this is where the conversion between
40  // datatypes happens.
41  FLA_Copy( r, x );
42 
43  FLA_Obj_free( &r );
44  FLA_Obj_free( &y );
45 
46  return FLA_SUCCESS;
47 }
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
unsigned long dim_t
Definition: FLA_type_defs.h:71
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition: FLA_Obj.c:588
FLA_Error FLA_Copy(FLA_Obj A, FLA_Obj B)
Definition: FLA_Copy.c:15
FLA_Error FLA_Fill_with_random_dist_check(FLA_Obj shift, FLA_Obj max, FLA_Obj x)
Definition: FLA_Fill_with_random_dist_check.c:13
FLA_Obj FLA_ONE_HALF
Definition: FLA_Init.c:19
FLA_Obj FLA_ONE
Definition: FLA_Init.c:18
FLA_Error FLA_Random_matrix(FLA_Obj A)
Definition: FLA_Random_matrix.c:13
Definition: FLA_type_defs.h:158
FLA_Error FLA_Set(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Set.c:13
FLA_Error FLA_Scal(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Scal.c:15
FLA_Datatype FLA_Obj_datatype_proj_to_real(FLA_Obj A)
Definition: FLA_Query.c:23
FLA_Error FLA_Axpy(FLA_Obj alpha, FLA_Obj A, FLA_Obj B)
Definition: FLA_Axpy.c:15
dim_t FLA_Obj_vector_dim(FLA_Obj obj)
Definition: FLA_Query.c:137
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49

◆ FLA_Fill_with_random_dist_check()

FLA_Error FLA_Fill_with_random_dist_check ( FLA_Obj  shift,
FLA_Obj  max,
FLA_Obj  x 
)

References FLA_Check_consistent_object_datatype(), FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_if_vector(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().

Referenced by FLA_Fill_with_random_dist().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( x );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( x );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_real_object( shift );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_consistent_object_datatype( shift, max );
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_identical_object_precision( x, max );
30  FLA_Check_error_code( e_val );
31 
32  e_val = FLA_Check_if_scalar( shift );
33  FLA_Check_error_code( e_val );
34 
35  e_val = FLA_Check_if_scalar( max );
36  FLA_Check_error_code( e_val );
37 
38  e_val = FLA_Check_if_vector( x );
39  FLA_Check_error_code( e_val );
40 
41  return FLA_SUCCESS;
42 }
FLA_Error FLA_Check_if_vector(FLA_Obj A)
Definition: FLA_Check.c:383
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:298
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_real_object(FLA_Obj A)
Definition: FLA_Check.c:258
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373
FLA_Error FLA_Check_consistent_object_datatype(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:339

◆ FLA_Hermitianize()

FLA_Error FLA_Hermitianize ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References bl1_csymmize(), bl1_dsymmize(), bl1_ssymmize(), bl1_zsymmize(), FLA_Check_error_level(), FLA_Hermitianize_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_conj(), and FLA_Param_map_flame_to_blis_uplo().

Referenced by FLA_Random_herm_matrix(), and FLASH_Hermitianize().

14 {
15  FLA_Datatype datatype;
16  dim_t n_A;
17  dim_t rs_A, cs_A;
18  conj1_t blis_conj;
19  uplo1_t blis_uplo;
20 
21  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
22  FLA_Hermitianize_check( uplo, A );
23 
24  datatype = FLA_Obj_datatype( A );
25 
26  n_A = FLA_Obj_width( A );
27  rs_A = FLA_Obj_row_stride( A );
28  cs_A = FLA_Obj_col_stride( A );
29 
30  FLA_Param_map_flame_to_blis_conj( FLA_CONJUGATE, &blis_conj );
31  FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo );
32 
33 
34  switch ( datatype ){
35 
36  case FLA_FLOAT:
37  {
38  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
39 
40  bl1_ssymmize( blis_conj,
41  blis_uplo,
42  n_A,
43  buff_A, rs_A, cs_A );
44 
45  break;
46  }
47 
48  case FLA_DOUBLE:
49  {
50  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
51 
52  bl1_dsymmize( blis_conj,
53  blis_uplo,
54  n_A,
55  buff_A, rs_A, cs_A );
56 
57  break;
58  }
59 
60  case FLA_COMPLEX:
61  {
62  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
63 
64  bl1_csymmize( blis_conj,
65  blis_uplo,
66  n_A,
67  buff_A, rs_A, cs_A );
68 
69  break;
70  }
71 
72  case FLA_DOUBLE_COMPLEX:
73  {
74  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
75 
76  bl1_zsymmize( blis_conj,
77  blis_uplo,
78  n_A,
79  buff_A, rs_A, cs_A );
80 
81  break;
82  }
83 
84  }
85 
86  return FLA_SUCCESS;
87 }
unsigned long dim_t
Definition: FLA_type_defs.h:71
uplo1_t
Definition: blis_type_defs.h:60
void bl1_ssymmize(conj1_t conj, uplo1_t uplo, int m, float *a, int a_rs, int a_cs)
Definition: bl1_symmize.c:13
void bl1_zsymmize(conj1_t conj, uplo1_t uplo, int m, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_symmize.c:353
conj1_t
Definition: blis_type_defs.h:79
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
void bl1_dsymmize(conj1_t conj, uplo1_t uplo, int m, double *a, int a_rs, int a_cs)
Definition: bl1_symmize.c:124
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void FLA_Param_map_flame_to_blis_uplo(FLA_Uplo uplo, uplo1_t *blis_uplo)
Definition: FLA_Param.c:285
Definition: blis_type_defs.h:132
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
void FLA_Param_map_flame_to_blis_conj(FLA_Conj conj, conj1_t *blis_conj)
Definition: FLA_Param.c:269
int FLA_Datatype
Definition: FLA_type_defs.h:49
FLA_Error FLA_Hermitianize_check(FLA_Uplo uplo, FLA_Obj A)
Definition: FLA_Hermitianize_check.c:13
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
void bl1_csymmize(conj1_t conj, uplo1_t uplo, int m, scomplex *a, int a_rs, int a_cs)
Definition: bl1_symmize.c:235
Definition: blis_type_defs.h:137

◆ FLA_Hermitianize_check()

FLA_Error FLA_Hermitianize_check ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_square(), and FLA_Check_valid_uplo().

Referenced by FLA_Hermitianize().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_uplo( uplo );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( A );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_square( A );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_square(FLA_Obj A)
Definition: FLA_Check.c:363
FLA_Error FLA_Check_valid_uplo(FLA_Uplo uplo)
Definition: FLA_Check.c:76

◆ FLA_Inv_scal_elemwise()

FLA_Error FLA_Inv_scal_elemwise ( FLA_Trans  trans,
FLA_Obj  A,
FLA_Obj  B 
)

References bl1_cewinvscalmt(), bl1_dewinvscalmt(), bl1_sewinvscalmt(), bl1_zewinvscalmt(), FLA_Check_error_level(), FLA_Inv_scal_elemwise_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Param_map_flame_to_blis_trans().

14 {
15  FLA_Datatype datatype;
16  int m_B, n_B;
17  int rs_A, cs_A;
18  int rs_B, cs_B;
19  trans1_t blis_trans;
20 
21  if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
22  FLA_Inv_scal_elemwise_check( trans, A, B );
23 
24  if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS;
25 
26  datatype = FLA_Obj_datatype( A );
27 
28  rs_A = FLA_Obj_row_stride( A );
29  cs_A = FLA_Obj_col_stride( A );
30 
31  m_B = FLA_Obj_length( B );
32  n_B = FLA_Obj_width( B );
33  rs_B = FLA_Obj_row_stride( B );
34  cs_B = FLA_Obj_col_stride( B );
35 
36  FLA_Param_map_flame_to_blis_trans( trans, &blis_trans );
37 
38  switch ( datatype ){
39 
40  case FLA_FLOAT:
41  {
42  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
43  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
44 
45  bl1_sewinvscalmt( blis_trans,
46  m_B,
47  n_B,
48  buff_A, rs_A, cs_A,
49  buff_B, rs_B, cs_B );
50 
51  break;
52  }
53 
54  case FLA_DOUBLE:
55  {
56  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
57  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
58 
59  bl1_dewinvscalmt( blis_trans,
60  m_B,
61  n_B,
62  buff_A, rs_A, cs_A,
63  buff_B, rs_B, cs_B );
64 
65  break;
66  }
67 
68  case FLA_COMPLEX:
69  {
70  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
71  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
72 
73  bl1_cewinvscalmt( blis_trans,
74  m_B,
75  n_B,
76  buff_A, rs_A, cs_A,
77  buff_B, rs_B, cs_B );
78 
79  break;
80  }
81 
82  case FLA_DOUBLE_COMPLEX:
83  {
84  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
85  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
86 
87  bl1_zewinvscalmt( blis_trans,
88  m_B,
89  n_B,
90  buff_A, rs_A, cs_A,
91  buff_B, rs_B, cs_B );
92 
93  break;
94  }
95 
96  }
97 
98  return FLA_SUCCESS;
99 }
void bl1_sewinvscalmt(trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_ewinvscalmt.c:13
void bl1_dewinvscalmt(trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_ewinvscalmt.c:85
void FLA_Param_map_flame_to_blis_trans(FLA_Trans trans, trans1_t *blis_trans)
Definition: FLA_Param.c:245
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
trans1_t
Definition: blis_type_defs.h:52
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
void bl1_zewinvscalmt(trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_ewinvscalmt.c:373
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition: FLA_Query.c:400
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
Definition: blis_type_defs.h:132
FLA_Error FLA_Inv_scal_elemwise_check(FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition: FLA_Inv_scal_elemwise_check.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
void bl1_cewinvscalmt(trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_ewinvscalmt.c:229
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
Definition: blis_type_defs.h:137

◆ FLA_Inv_scal_elemwise_check()

FLA_Error FLA_Inv_scal_elemwise_check ( FLA_Trans  trans,
FLA_Obj  A,
FLA_Obj  B 
)

References FLA_Check_conformal_dims(), FLA_Check_floating_object(), FLA_Check_identical_object_datatype(), FLA_Check_nonconstant_object(), and FLA_Check_valid_trans().

Referenced by FLA_Inv_scal_elemwise().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_trans( trans );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( A );
24  FLA_Check_error_code( e_val );
25 
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_conformal_dims( trans, A, B );
30  FLA_Check_error_code( e_val );
31 
32  return FLA_SUCCESS;
33 }
FLA_Error FLA_Check_identical_object_datatype(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:967
FLA_Error FLA_Check_valid_trans(FLA_Trans trans)
Definition: FLA_Check.c:87
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_conformal_dims(FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:393

◆ FLA_Invert()

FLA_Error FLA_Invert ( FLA_Conj  conj,
FLA_Obj  x 
)

References bl1_cinvertv(), bl1_dinvertv(), bl1_sinvertv(), bl1_zinvertv(), FLA_Check_error_level(), FLA_Invert_check(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_vector_dim(), FLA_Obj_vector_inc(), and FLA_Param_map_flame_to_blis_conj().

Referenced by FLA_Fill_with_inverse_dist(), FLA_Hevd_compute_scaling(), FLA_Svd_compute_scaling(), FLA_Trinv_ln_unb_var1(), FLA_Trinv_ln_unb_var2(), FLA_Trinv_ln_unb_var3(), FLA_Trinv_ln_unb_var4(), FLA_Trinv_un_unb_var1(), FLA_Trinv_un_unb_var2(), FLA_Trinv_un_unb_var3(), and FLA_Trinv_un_unb_var4().

14 {
15  FLA_Datatype datatype;
16  int n_elem;
17  int inc_x;
18  conj1_t blis_conj;
19 
20  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
21  FLA_Invert_check( conj, x );
22 
23  if ( FLA_Obj_has_zero_dim( x ) ) return FLA_SUCCESS;
24 
25  datatype = FLA_Obj_datatype( x );
26 
27  n_elem = FLA_Obj_vector_dim( x );
28  inc_x = FLA_Obj_vector_inc( x );
29 
30  FLA_Param_map_flame_to_blis_conj( conj, &blis_conj );
31 
32 
33  switch ( datatype ){
34 
35  case FLA_FLOAT:
36  {
37  float *buff_x = ( float * ) FLA_FLOAT_PTR( x );
38 
39  bl1_sinvertv( blis_conj,
40  n_elem,
41  buff_x, inc_x );
42 
43  break;
44  }
45 
46  case FLA_DOUBLE:
47  {
48  double *buff_x = ( double * ) FLA_DOUBLE_PTR( x );
49 
50  bl1_dinvertv( blis_conj,
51  n_elem,
52  buff_x, inc_x );
53 
54  break;
55  }
56 
57  case FLA_COMPLEX:
58  {
59  scomplex *buff_x = ( scomplex * ) FLA_COMPLEX_PTR( x );
60 
61  bl1_cinvertv( blis_conj,
62  n_elem,
63  buff_x, inc_x );
64 
65  break;
66  }
67 
68  case FLA_DOUBLE_COMPLEX:
69  {
70  dcomplex *buff_x = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( x );
71 
72  bl1_zinvertv( blis_conj,
73  n_elem,
74  buff_x, inc_x );
75 
76  break;
77  }
78 
79  }
80 
81  return FLA_SUCCESS;
82 }
FLA_Error FLA_Invert_check(FLA_Conj conj, FLA_Obj x)
Definition: FLA_Invert_check.c:13
conj1_t
Definition: blis_type_defs.h:79
void bl1_zinvertv(conj1_t conj, int n, dcomplex *x, int incx)
Definition: bl1_invertv.c:67
void bl1_sinvertv(conj1_t conj, int n, float *x, int incx)
Definition: bl1_invertv.c:13
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition: FLA_Query.c:400
Definition: blis_type_defs.h:132
dim_t FLA_Obj_vector_dim(FLA_Obj obj)
Definition: FLA_Query.c:137
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
void FLA_Param_map_flame_to_blis_conj(FLA_Conj conj, conj1_t *blis_conj)
Definition: FLA_Param.c:269
int FLA_Datatype
Definition: FLA_type_defs.h:49
void bl1_cinvertv(conj1_t conj, int n, scomplex *x, int incx)
Definition: bl1_invertv.c:41
dim_t FLA_Obj_vector_inc(FLA_Obj obj)
Definition: FLA_Query.c:145
void bl1_dinvertv(conj1_t conj, int n, double *x, int incx)
Definition: bl1_invertv.c:27
Definition: blis_type_defs.h:137

◆ FLA_Invert_check()

FLA_Error FLA_Invert_check ( FLA_Conj  conj,
FLA_Obj  x 
)

References FLA_Check_floating_object(), FLA_Check_if_vector(), FLA_Check_nonconstant_object(), and FLA_Check_valid_conj().

Referenced by FLA_Invert().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_conj( conj );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( x );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( x );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_if_vector( x );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
FLA_Error FLA_Check_if_vector(FLA_Obj A)
Definition: FLA_Check.c:383
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_valid_conj(FLA_Conj conj)
Definition: FLA_Check.c:112

◆ FLA_Max_abs_value()

FLA_Error FLA_Max_abs_value ( FLA_Obj  A,
FLA_Obj  amax 
)

References bl1_cmaxabsm(), bl1_dmaxabsm(), bl1_smaxabsm(), bl1_zmaxabsm(), FLA_Check_error_level(), FLA_Max_abs_value_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), scomplex::imag, dcomplex::imag, scomplex::real, and dcomplex::real.

Referenced by FLA_Norm1(), FLA_Norm_inf(), FLA_Svd_compute_scaling(), and FLA_Svd_ext_u_unb_var1().

14 {
15  FLA_Datatype datatype;
16  FLA_Datatype dt_maxabs;
17  dim_t m_A, n_A;
18  dim_t rs_A, cs_A;
19 
20  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
21  FLA_Max_abs_value_check( A, maxabs );
22 
23  datatype = FLA_Obj_datatype( A );
24  dt_maxabs = FLA_Obj_datatype( maxabs );
25 
26  m_A = FLA_Obj_length( A );
27  n_A = FLA_Obj_width( A );
28  rs_A = FLA_Obj_row_stride( A );
29  cs_A = FLA_Obj_col_stride( A );
30 
31 
32  switch ( datatype ){
33 
34  case FLA_FLOAT:
35  {
36  float* buff_A = ( float * ) FLA_FLOAT_PTR( A );
37  float* buff_maxabs = ( float * ) FLA_FLOAT_PTR( maxabs );
38 
39  bl1_smaxabsm( m_A,
40  n_A,
41  buff_A, rs_A, cs_A,
42  buff_maxabs );
43 
44  break;
45  }
46 
47  case FLA_DOUBLE:
48  {
49  double* buff_A = ( double * ) FLA_DOUBLE_PTR( A );
50  double* buff_maxabs = ( double * ) FLA_DOUBLE_PTR( maxabs );
51 
52  bl1_dmaxabsm( m_A,
53  n_A,
54  buff_A, rs_A, cs_A,
55  buff_maxabs );
56 
57  break;
58  }
59 
60  case FLA_COMPLEX:
61  {
62  if ( dt_maxabs == FLA_FLOAT )
63  {
64  scomplex* buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
65  float* buff_maxabs = ( float * ) FLA_FLOAT_PTR( maxabs );
66 
67  bl1_cmaxabsm( m_A,
68  n_A,
69  buff_A, rs_A, cs_A,
70  buff_maxabs );
71  }
72  else
73  {
74  scomplex* buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
75  scomplex* buff_maxabs = ( scomplex * ) FLA_COMPLEX_PTR( maxabs );
76 
77  bl1_cmaxabsm( m_A,
78  n_A,
79  buff_A, rs_A, cs_A,
80  &(buff_maxabs->real) );
81 
82  buff_maxabs->imag = 0.0;
83  }
84 
85  break;
86  }
87 
88  case FLA_DOUBLE_COMPLEX:
89  {
90  if ( dt_maxabs == FLA_DOUBLE )
91  {
92  dcomplex* buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
93  double* buff_maxabs = ( double * ) FLA_DOUBLE_PTR( maxabs );
94 
95  bl1_zmaxabsm( m_A,
96  n_A,
97  buff_A, rs_A, cs_A,
98  buff_maxabs );
99  }
100  else
101  {
102  dcomplex* buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
103  dcomplex* buff_maxabs = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( maxabs );
104 
105  bl1_zmaxabsm( m_A,
106  n_A,
107  buff_A, rs_A, cs_A,
108  &(buff_maxabs->real) );
109 
110  buff_maxabs->imag = 0.0;
111  }
112 
113  break;
114  }
115 
116  }
117 
118  return FLA_SUCCESS;
119 }
float real
Definition: blis_type_defs.h:134
void bl1_dmaxabsm(int m, int n, double *a, int a_rs, int a_cs, double *maxabs)
Definition: bl1_maxabsm.c:58
unsigned long dim_t
Definition: FLA_type_defs.h:71
void bl1_cmaxabsm(int m, int n, scomplex *a, int a_rs, int a_cs, float *maxabs)
Definition: bl1_maxabsm.c:103
double imag
Definition: blis_type_defs.h:139
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
double real
Definition: blis_type_defs.h:139
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void bl1_smaxabsm(int m, int n, float *a, int a_rs, int a_cs, float *maxabs)
Definition: bl1_maxabsm.c:13
Definition: blis_type_defs.h:132
void bl1_zmaxabsm(int m, int n, dcomplex *a, int a_rs, int a_cs, double *maxabs)
Definition: bl1_maxabsm.c:148
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
FLA_Error FLA_Max_abs_value_check(FLA_Obj A, FLA_Obj amax)
Definition: FLA_Max_abs_value_check.c:13
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
float imag
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:137

◆ FLA_Max_abs_value_check()

FLA_Error FLA_Max_abs_value_check ( FLA_Obj  A,
FLA_Obj  amax 
)

References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().

Referenced by FLA_Max_abs_value().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( A );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( A );
21  FLA_Check_error_code( e_val );
22 
23 // e_val = FLA_Check_real_object( amax );
24 // FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_identical_object_precision( A, amax );
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_if_scalar( amax );
30  FLA_Check_error_code( e_val );
31 
32  return FLA_SUCCESS;
33 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:298
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373

◆ FLA_Max_abs_value_herm()

FLA_Error FLA_Max_abs_value_herm ( FLA_Uplo  uplo,
FLA_Obj  A,
FLA_Obj  maxabs 
)

References bl1_cmaxabsmr(), bl1_dmaxabsmr(), bl1_smaxabsmr(), bl1_zmaxabsmr(), FLA_Check_error_level(), FLA_Max_abs_value_herm_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Param_map_flame_to_blis_uplo().

Referenced by FLA_Hevd_compute_scaling().

14 {
15  FLA_Datatype datatype;
16  dim_t n_A;
17  dim_t rs_A, cs_A;
18  uplo1_t blis_uplo;
19 
20  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
21  FLA_Max_abs_value_herm_check( uplo, A, maxabs );
22 
23  datatype = FLA_Obj_datatype( A );
24 
25  n_A = FLA_Obj_width( A );
26  rs_A = FLA_Obj_row_stride( A );
27  cs_A = FLA_Obj_col_stride( A );
28 
29  FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo );
30 
31  switch ( datatype ){
32 
33  case FLA_FLOAT:
34  {
35  float* buff_A = ( float * ) FLA_FLOAT_PTR( A );
36  float* buff_maxabs = ( float * ) FLA_FLOAT_PTR( maxabs );
37 
38  bl1_smaxabsmr( blis_uplo,
39  n_A,
40  n_A,
41  buff_A, rs_A, cs_A,
42  buff_maxabs );
43 
44  break;
45  }
46 
47  case FLA_DOUBLE:
48  {
49  double* buff_A = ( double * ) FLA_DOUBLE_PTR( A );
50  double* buff_maxabs = ( double * ) FLA_DOUBLE_PTR( maxabs );
51 
52  bl1_dmaxabsmr( blis_uplo,
53  n_A,
54  n_A,
55  buff_A, rs_A, cs_A,
56  buff_maxabs );
57 
58  break;
59  }
60 
61  case FLA_COMPLEX:
62  {
63  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
64  float *buff_maxabs = ( float * ) FLA_FLOAT_PTR( maxabs );
65 
66  bl1_cmaxabsmr( blis_uplo,
67  n_A,
68  n_A,
69  buff_A, rs_A, cs_A,
70  buff_maxabs );
71 
72  break;
73  }
74 
75  case FLA_DOUBLE_COMPLEX:
76  {
77  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
78  double *buff_maxabs = ( double * ) FLA_DOUBLE_PTR( maxabs );
79 
80  bl1_zmaxabsmr( blis_uplo,
81  n_A,
82  n_A,
83  buff_A, rs_A, cs_A,
84  buff_maxabs );
85 
86  break;
87  }
88 
89  }
90 
91  return FLA_SUCCESS;
92 }
void bl1_zmaxabsmr(uplo1_t uplo, int m, int n, dcomplex *a, int a_rs, int a_cs, double *maxabs)
Definition: bl1_maxabsmr.c:208
unsigned long dim_t
Definition: FLA_type_defs.h:71
uplo1_t
Definition: blis_type_defs.h:60
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void FLA_Param_map_flame_to_blis_uplo(FLA_Uplo uplo, uplo1_t *blis_uplo)
Definition: FLA_Param.c:285
Definition: blis_type_defs.h:132
void bl1_smaxabsmr(uplo1_t uplo, int m, int n, float *a, int a_rs, int a_cs, float *maxabs)
Definition: bl1_maxabsmr.c:13
void bl1_dmaxabsmr(uplo1_t uplo, int m, int n, double *a, int a_rs, int a_cs, double *maxabs)
Definition: bl1_maxabsmr.c:78
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
FLA_Error FLA_Max_abs_value_herm_check(FLA_Uplo uplo, FLA_Obj A, FLA_Obj maxabs)
Definition: FLA_Max_abs_value_herm_check.c:13
void bl1_cmaxabsmr(uplo1_t uplo, int m, int n, scomplex *a, int a_rs, int a_cs, float *maxabs)
Definition: bl1_maxabsmr.c:143
Definition: blis_type_defs.h:137

◆ FLA_Max_abs_value_herm_check()

FLA_Error FLA_Max_abs_value_herm_check ( FLA_Uplo  uplo,
FLA_Obj  A,
FLA_Obj  maxabs 
)

References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), FLA_Check_real_object(), and FLA_Check_valid_uplo().

Referenced by FLA_Max_abs_value_herm().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_uplo( uplo );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( A );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_real_object( maxabs );
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_nonconstant_object( maxabs );
30  FLA_Check_error_code( e_val );
31 
32  e_val = FLA_Check_identical_object_precision( A, maxabs );
33  FLA_Check_error_code( e_val );
34 
35  e_val = FLA_Check_if_scalar( maxabs );
36  FLA_Check_error_code( e_val );
37 
38  return FLA_SUCCESS;
39 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:298
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_real_object(FLA_Obj A)
Definition: FLA_Check.c:258
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373
FLA_Error FLA_Check_valid_uplo(FLA_Uplo uplo)
Definition: FLA_Check.c:76

◆ FLA_Max_elemwise_diff()

double FLA_Max_elemwise_diff ( FLA_Obj  A,
FLA_Obj  B 
)

References FLA_Check_error_level(), FLA_Max_elemwise_diff_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), i, and imag.

Referenced by FLASH_Max_elemwise_diff().

14 {
15  FLA_Datatype datatype;
16  dim_t i, j;
17  dim_t m_A, n_A;
18  dim_t rs_A, cs_A;
19  dim_t rs_B, cs_B;
20  double diff;
21  double d_max = 0.0;
22 
23  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
25 
26  datatype = FLA_Obj_datatype( A );
27 
28  m_A = FLA_Obj_length( A );
29  n_A = FLA_Obj_width( A );
30  rs_A = FLA_Obj_row_stride( A );
31  cs_A = FLA_Obj_col_stride( A );
32 
33  rs_B = FLA_Obj_row_stride( B );
34  cs_B = FLA_Obj_col_stride( B );
35 
36  switch ( datatype ){
37 
38  case FLA_FLOAT:
39  {
40  float *buff_a = ( float * ) FLA_FLOAT_PTR( A );
41  float *buff_b = ( float * ) FLA_FLOAT_PTR( B );
42 
43  for( j = 0; j < n_A; j++ )
44  {
45  for( i = 0; i < m_A; i++ )
46  {
47  diff = ( double ) ( buff_a[ j*cs_A + i*rs_A ] - buff_b[ j*cs_B + i*rs_B ] );
48 
49  if( fabs(diff) > d_max )
50  d_max = fabs(diff);
51  }
52  }
53 
54  break;
55  }
56 
57  case FLA_DOUBLE:
58  {
59  double *buff_a = ( double * ) FLA_DOUBLE_PTR( A );
60  double *buff_b = ( double * ) FLA_DOUBLE_PTR( B );
61 
62  for( j = 0; j < n_A; j++ )
63  {
64  for( i = 0; i < m_A; i++ )
65  {
66  diff = ( double ) ( buff_a[ j*cs_A + i*rs_A ] - buff_b[ j*cs_B + i*rs_B ] );
67 
68  if( fabs(diff) > d_max )
69  d_max = fabs(diff);
70  }
71  }
72 
73  break;
74  }
75 
76  case FLA_COMPLEX:
77  {
78  scomplex *buff_a = ( scomplex * ) FLA_COMPLEX_PTR( A );
79  scomplex *buff_b = ( scomplex * ) FLA_COMPLEX_PTR( B );
80 
81  for( j = 0; j < n_A; j++ )
82  {
83  for( i = 0; i < m_A; i++ )
84  {
85  diff = ( double ) ( buff_a[ j*cs_A + i*rs_A ].real - buff_b[ j*cs_B + i*rs_B ].real );
86 
87  if( fabs(diff) > d_max )
88  d_max = fabs(diff);
89 
90  diff = ( double ) ( buff_a[ j*cs_A + i*rs_A ].imag - buff_b[ j*cs_B + i*rs_B ].imag );
91 
92  if( fabs(diff) > d_max )
93  d_max = fabs(diff);
94  }
95  }
96 
97  break;
98  }
99 
100  case FLA_DOUBLE_COMPLEX:
101  {
102  dcomplex *buff_a = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
103  dcomplex *buff_b = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
104 
105  for( j = 0; j < n_A; j++ )
106  {
107  for( i = 0; i < m_A; i++ )
108  {
109  diff = ( double ) ( buff_a[ j*cs_A + i*rs_A ].real - buff_b[ j*cs_B + i*rs_B ].real );
110 
111  if( fabs(diff) > d_max )
112  d_max = fabs(diff);
113 
114  diff = ( double ) ( buff_a[ j*cs_A + i*rs_A ].imag - buff_b[ j*cs_B + i*rs_B ].imag );
115 
116  if( fabs(diff) > d_max )
117  d_max = fabs(diff);
118  }
119  }
120 
121  break;
122  }
123 
124  }
125 
126 
127  return d_max;
128 }
unsigned long dim_t
Definition: FLA_type_defs.h:71
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
float real
Definition: FLA_f2c.h:30
FLA_Error FLA_Max_elemwise_diff_check(FLA_Obj A, FLA_Obj B)
Definition: FLA_Max_elemwise_diff_check.c:13
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
rho_c imag
Definition: bl1_axpyv2bdotaxpy.c:483
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
Definition: blis_type_defs.h:132
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
int i
Definition: bl1_axmyv2.c:145
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
Definition: blis_type_defs.h:137

◆ FLA_Max_elemwise_diff_check()

FLA_Error FLA_Max_elemwise_diff_check ( FLA_Obj  A,
FLA_Obj  B 
)

References FLA_Check_conformal_dims(), FLA_Check_floating_object(), FLA_Check_identical_object_datatype(), and FLA_Check_nonconstant_object().

Referenced by FLA_Max_elemwise_diff().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( A );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( A );
21  FLA_Check_error_code( e_val );
22 
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_conformal_dims( FLA_NO_TRANSPOSE, A, B );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
FLA_Error FLA_Check_identical_object_datatype(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:967
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_conformal_dims(FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:393

◆ FLA_Mult_add()

FLA_Error FLA_Mult_add ( FLA_Obj  alpha,
FLA_Obj  beta,
FLA_Obj  gamma 
)

References FLA_Check_error_level(), FLA_Mult_add_check(), FLA_Obj_datatype(), scomplex::imag, dcomplex::imag, scomplex::real, and dcomplex::real.

Referenced by FLA_Bidiag_UT_u_step_unb_var3(), FLA_Bidiag_UT_u_step_unb_var4(), FLA_Fill_with_cluster_dist(), FLA_Fill_with_geometric_dist(), FLA_Fill_with_inverse_dist(), FLA_Fill_with_linear_dist(), FLA_Fill_with_logarithmic_dist(), FLA_Lyap_h_unb_var1(), FLA_Lyap_h_unb_var2(), FLA_Lyap_h_unb_var3(), FLA_Lyap_h_unb_var4(), FLA_Lyap_n_unb_var1(), FLA_Lyap_n_unb_var2(), FLA_Lyap_n_unb_var3(), and FLA_Lyap_n_unb_var4().

14 {
15  FLA_Datatype datatype;
16 
17  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
18  FLA_Mult_add_check( alpha, beta, gamma );
19 
20  datatype = FLA_Obj_datatype( gamma );
21 
22  switch ( datatype ){
23 
24  case FLA_FLOAT:
25  {
26  float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
27  float *buff_beta = ( float * ) FLA_FLOAT_PTR( beta );
28  float *buff_gamma = ( float * ) FLA_FLOAT_PTR( gamma );
29 
30  *buff_gamma = *buff_gamma + *buff_alpha * *buff_beta;
31 
32  break;
33  }
34 
35  case FLA_DOUBLE:
36  {
37  double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
38  double *buff_beta = ( double * ) FLA_DOUBLE_PTR( beta );
39  double *buff_gamma = ( double * ) FLA_DOUBLE_PTR( gamma );
40 
41  *buff_gamma = *buff_gamma + *buff_alpha * *buff_beta;
42 
43  break;
44  }
45 
46  case FLA_COMPLEX:
47  {
48  scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha );
49  scomplex *buff_beta = ( scomplex * ) FLA_COMPLEX_PTR( beta );
50  scomplex *buff_gamma = ( scomplex * ) FLA_COMPLEX_PTR( gamma );
51  scomplex alphabeta;
52 
53  alphabeta.real = buff_alpha->real * buff_beta->real -
54  buff_alpha->imag * buff_beta->imag;
55 
56  alphabeta.imag = buff_alpha->real * buff_beta->imag +
57  buff_alpha->imag * buff_beta->real;
58 
59  buff_gamma->real = buff_gamma->real + alphabeta.real;
60  buff_gamma->imag = buff_gamma->imag + alphabeta.imag;
61 
62  break;
63  }
64 
65  case FLA_DOUBLE_COMPLEX:
66  {
67  dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha );
68  dcomplex *buff_beta = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( beta );
69  dcomplex *buff_gamma = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( gamma );
70  dcomplex alphabeta;
71 
72  alphabeta.real = buff_alpha->real * buff_beta->real -
73  buff_alpha->imag * buff_beta->imag;
74 
75  alphabeta.imag = buff_alpha->real * buff_beta->imag +
76  buff_alpha->imag * buff_beta->real;
77 
78  buff_gamma->real = buff_gamma->real + alphabeta.real;
79  buff_gamma->imag = buff_gamma->imag + alphabeta.imag;
80 
81  break;
82  }
83 
84  }
85 
86  return FLA_SUCCESS;
87 }
float real
Definition: blis_type_defs.h:134
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
FLA_Error FLA_Mult_add_check(FLA_Obj alpha, FLA_Obj beta, FLA_Obj gamma)
Definition: FLA_Mult_add_check.c:13
Definition: blis_type_defs.h:132
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
float imag
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:137

◆ FLA_Mult_add_check()

FLA_Error FLA_Mult_add_check ( FLA_Obj  alpha,
FLA_Obj  beta,
FLA_Obj  gamma 
)

References FLA_Check_floating_object(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().

Referenced by FLA_Mult_add().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( alpha );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( beta );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_floating_object( gamma );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_if_scalar( alpha );
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_if_scalar( beta );
30  FLA_Check_error_code( e_val );
31 
32  e_val = FLA_Check_if_scalar( gamma );
33  FLA_Check_error_code( e_val );
34 
35  e_val = FLA_Check_nonconstant_object( gamma );
36  FLA_Check_error_code( e_val );
37 
38  return FLA_SUCCESS;
39 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373

◆ FLA_Negate()

FLA_Error FLA_Negate ( FLA_Obj  x)

References FLA_Check_error_level(), FLA_MINUS_ONE, FLA_Negate_check(), and FLA_Scal().

14 {
15  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
16  FLA_Negate_check( x );
17 
18  return FLA_Scal( FLA_MINUS_ONE, x );
19 }
FLA_Obj FLA_MINUS_ONE
Definition: FLA_Init.c:22
FLA_Error FLA_Negate_check(FLA_Obj x)
Definition: FLA_Negate_check.c:13
FLA_Error FLA_Scal(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Scal.c:15
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18

◆ FLA_Negate_check()

FLA_Error FLA_Negate_check ( FLA_Obj  x)

References FLA_Check_floating_object(), and FLA_Check_nonconstant_object().

Referenced by FLA_Negate().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( x );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( x );
21  FLA_Check_error_code( e_val );
22 
23  return FLA_SUCCESS;
24 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232

◆ FLA_Norm1()

FLA_Error FLA_Norm1 ( FLA_Obj  A,
FLA_Obj  norm 
)

References FLA_Asum(), FLA_Check_error_level(), FLA_Cont_with_1x3_to_1x2(), FLA_Max_abs_value(), FLA_Norm1_check(), FLA_Obj_create(), FLA_Obj_datatype(), FLA_Obj_free(), FLA_Obj_width(), FLA_Part_1x2(), and FLA_Repart_1x2_to_1x3().

Referenced by FLASH_Norm1().

14 {
15  FLA_Obj AL, AR, A0, a1, A2;
16 
17  FLA_Obj b;
18  FLA_Obj bL, bR, b0, beta1, b2;
19 
20  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
21  FLA_Norm1_check( A, norm );
22 
23  FLA_Obj_create( FLA_Obj_datatype( A ), 1, FLA_Obj_width( A ), 0, 0, &b );
24 
25  FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT );
26 
27  FLA_Part_1x2( b, &bL, &bR, 0, FLA_LEFT );
28 
29  while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){
30 
31  FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &a1, &A2,
32  1, FLA_RIGHT );
33 
34  FLA_Repart_1x2_to_1x3( bL, /**/ bR, &b0, /**/ &beta1, &b2,
35  1, FLA_RIGHT );
36 
37  /*------------------------------------------------------------*/
38 
39  FLA_Asum( a1, beta1 );
40 
41  /*------------------------------------------------------------*/
42 
43  FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, a1, /**/ A2,
44  FLA_LEFT );
45 
46  FLA_Cont_with_1x3_to_1x2( &bL, /**/ &bR, b0, beta1, /**/ b2,
47  FLA_LEFT );
48  }
49 
50  FLA_Max_abs_value( b, norm );
51 
52  FLA_Obj_free( &b );
53 
54  return FLA_SUCCESS;
55 }
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_Error FLA_Repart_1x2_to_1x3(FLA_Obj AL, FLA_Obj AR, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj *A2, dim_t nb, FLA_Side side)
Definition: FLA_View.c:267
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition: FLA_Obj.c:588
FLA_Error FLA_Max_abs_value(FLA_Obj A, FLA_Obj amax)
Definition: FLA_Max_abs_value.c:13
FLA_Error FLA_Asum(FLA_Obj x, FLA_Obj asum_x)
Definition: FLA_Asum.c:13
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
Definition: FLA_type_defs.h:158
FLA_Error FLA_Norm1_check(FLA_Obj A, FLA_Obj norm)
Definition: FLA_Norm1_check.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
FLA_Error FLA_Cont_with_1x3_to_1x2(FLA_Obj *AL, FLA_Obj *AR, FLA_Obj A0, FLA_Obj A1, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:475
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
FLA_Error FLA_Part_1x2(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t nb, FLA_Side side)
Definition: FLA_View.c:110

◆ FLA_Norm1_check()

FLA_Error FLA_Norm1_check ( FLA_Obj  A,
FLA_Obj  norm 
)

References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().

Referenced by FLA_Norm1().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( A );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_identical_object_precision( A, norm );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_if_scalar( norm );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:298
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373

◆ FLA_Norm_frob()

FLA_Error FLA_Norm_frob ( FLA_Obj  A,
FLA_Obj  norm 
)

References bl1_cfnorm(), bl1_dfnorm(), bl1_sfnorm(), bl1_zfnorm(), FLA_Check_error_level(), FLA_Norm_frob_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), and FLA_Obj_width().

14 {
15  FLA_Datatype datatype;
16  int m_A, n_A;
17  int rs_A, cs_A;
18 
19  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
20  FLA_Norm_frob_check( A, norm );
21 
22  datatype = FLA_Obj_datatype( A );
23 
24  m_A = FLA_Obj_length( A );
25  n_A = FLA_Obj_width( A );
26  rs_A = FLA_Obj_row_stride( A );
27  cs_A = FLA_Obj_col_stride( A );
28 
29 
30  switch ( datatype ){
31 
32  case FLA_FLOAT:
33  {
34  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
35  float *buff_norm = ( float * ) FLA_FLOAT_PTR( norm );
36 
37  bl1_sfnorm( m_A,
38  n_A,
39  buff_A, rs_A, cs_A,
40  buff_norm );
41 
42  break;
43  }
44 
45  case FLA_DOUBLE:
46  {
47  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
48  double *buff_norm = ( double * ) FLA_DOUBLE_PTR( norm );
49 
50  bl1_dfnorm( m_A,
51  n_A,
52  buff_A, rs_A, cs_A,
53  buff_norm );
54 
55  break;
56  }
57 
58  case FLA_COMPLEX:
59  {
60  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
61  float *buff_norm = ( float * ) FLA_FLOAT_PTR( norm );
62 
63  bl1_cfnorm( m_A,
64  n_A,
65  buff_A, rs_A, cs_A,
66  buff_norm );
67 
68  break;
69  }
70 
71  case FLA_DOUBLE_COMPLEX:
72  {
73  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
74  double *buff_norm = ( double * ) FLA_DOUBLE_PTR( norm );
75 
76  bl1_zfnorm( m_A,
77  n_A,
78  buff_A, rs_A, cs_A,
79  buff_norm );
80 
81  break;
82  }
83 
84  }
85 
86  return FLA_SUCCESS;
87 }
void bl1_cfnorm(int m, int n, scomplex *a, int a_rs, int a_cs, float *norm)
Definition: bl1_fnorm.c:121
void bl1_dfnorm(int m, int n, double *a, int a_rs, int a_cs, double *norm)
Definition: bl1_fnorm.c:67
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
void bl1_zfnorm(int m, int n, dcomplex *a, int a_rs, int a_cs, double *norm)
Definition: bl1_fnorm.c:175
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void bl1_sfnorm(int m, int n, float *a, int a_rs, int a_cs, float *norm)
Definition: bl1_fnorm.c:13
Definition: blis_type_defs.h:132
FLA_Error FLA_Norm_frob_check(FLA_Obj A, FLA_Obj norm)
Definition: FLA_Norm_frob_check.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
Definition: blis_type_defs.h:137

◆ FLA_Norm_frob_check()

FLA_Error FLA_Norm_frob_check ( FLA_Obj  A,
FLA_Obj  norm 
)

References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().

Referenced by FLA_Norm_frob().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( A );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_real_object( norm );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_identical_object_precision( A, norm );
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_if_scalar( norm );
30  FLA_Check_error_code( e_val );
31 
32  return FLA_SUCCESS;
33 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:298
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_real_object(FLA_Obj A)
Definition: FLA_Check.c:258
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373

◆ FLA_Norm_inf()

FLA_Error FLA_Norm_inf ( FLA_Obj  A,
FLA_Obj  norm 
)

References FLA_Asum(), FLA_Check_error_level(), FLA_Cont_with_3x1_to_2x1(), FLA_Max_abs_value(), FLA_Norm_inf_check(), FLA_Obj_create(), FLA_Obj_datatype(), FLA_Obj_free(), FLA_Obj_length(), FLA_Part_2x1(), and FLA_Repart_2x1_to_3x1().

14 {
15  FLA_Obj AT, A0,
16  AB, a1t,
17  A2;
18 
19  FLA_Obj bT, b0,
20  bB, beta1,
21  b2;
22  FLA_Obj b;
23 
24  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
25  FLA_Norm_inf_check( A, norm );
26 
27  FLA_Obj_create( FLA_Obj_datatype( A ), FLA_Obj_length( A ), 1, 0, 0, &b );
28 
29  FLA_Part_2x1( A, &AT,
30  &AB, 0, FLA_TOP );
31 
32  FLA_Part_2x1( b, &bT,
33  &bB, 0, FLA_TOP );
34 
35  while ( FLA_Obj_length( AT ) < FLA_Obj_length( A ) ){
36 
37  FLA_Repart_2x1_to_3x1( AT, &A0,
38  /* ** */ /* *** */
39  &a1t,
40  AB, &A2, 1, FLA_BOTTOM );
41 
42  FLA_Repart_2x1_to_3x1( bT, &b0,
43  /* ** */ /* ***** */
44  &beta1,
45  bB, &b2, 1, FLA_BOTTOM );
46 
47  /*------------------------------------------------------------*/
48 
49  FLA_Asum( a1t, beta1 );
50 
51  /*------------------------------------------------------------*/
52 
53  FLA_Cont_with_3x1_to_2x1( &AT, A0,
54  a1t,
55  /* ** */ /* *** */
56  &AB, A2, FLA_TOP );
57 
58  FLA_Cont_with_3x1_to_2x1( &bT, b0,
59  beta1,
60  /* ** */ /* ***** */
61  &bB, b2, FLA_TOP );
62 
63  }
64 
65  FLA_Max_abs_value( b, norm );
66 
67  FLA_Obj_free( &b );
68 
69  return FLA_SUCCESS;
70 }
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_Error FLA_Repart_2x1_to_3x1(FLA_Obj AT, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj AB, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:226
FLA_Error FLA_Norm_inf_check(FLA_Obj A, FLA_Obj norm)
Definition: FLA_Norm_inf_check.c:13
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition: FLA_Obj.c:588
FLA_Error FLA_Cont_with_3x1_to_2x1(FLA_Obj *AT, FLA_Obj A0, FLA_Obj A1, FLA_Obj *AB, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:428
FLA_Error FLA_Max_abs_value(FLA_Obj A, FLA_Obj amax)
Definition: FLA_Max_abs_value.c:13
FLA_Error FLA_Asum(FLA_Obj x, FLA_Obj asum_x)
Definition: FLA_Asum.c:13
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
Definition: FLA_type_defs.h:158
FLA_Error FLA_Part_2x1(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:76
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116

◆ FLA_Norm_inf_check()

FLA_Error FLA_Norm_inf_check ( FLA_Obj  A,
FLA_Obj  norm 
)

References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().

Referenced by FLA_Norm_inf().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( A );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_real_object( norm );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_identical_object_precision( A, norm );
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_if_scalar( norm );
30  FLA_Check_error_code( e_val );
31 
32  return FLA_SUCCESS;
33 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:298
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_real_object(FLA_Obj A)
Definition: FLA_Check.c:258
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373

◆ FLA_Pow()

FLA_Error FLA_Pow ( FLA_Obj  base,
FLA_Obj  exp,
FLA_Obj  btoe 
)

References FLA_Check_error_level(), FLA_Obj_datatype(), FLA_Pow_check(), scomplex::imag, dcomplex::imag, scomplex::real, and dcomplex::real.

Referenced by FLA_Fill_with_geometric_dist(), and FLA_Fill_with_logarithmic_dist().

14 {
15  FLA_Datatype datatype;
16  int r_val = FLA_SUCCESS;
17 
18  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
19  FLA_Pow_check( base, exp, btoe );
20 
21  datatype = FLA_Obj_datatype( base );
22 
23  switch ( datatype ){
24 
25  case FLA_FLOAT:
26  {
27  float *buff_base = ( float * ) FLA_FLOAT_PTR( base );
28  float *buff_exp = ( float * ) FLA_FLOAT_PTR( exp );
29  float *buff_btoe = ( float * ) FLA_FLOAT_PTR( btoe );
30 
31  *buff_btoe = ( float ) pow( *buff_base, *buff_exp );
32 
33  break;
34  }
35 
36  case FLA_DOUBLE:
37  {
38  double *buff_base = ( double * ) FLA_DOUBLE_PTR( base );
39  double *buff_exp = ( double * ) FLA_DOUBLE_PTR( exp );
40  double *buff_btoe = ( double * ) FLA_DOUBLE_PTR( btoe );
41 
42  *buff_btoe = ( double ) pow( *buff_base, *buff_exp );
43 
44  break;
45  }
46 
47  case FLA_COMPLEX:
48  {
49  scomplex *buff_base = ( scomplex * ) FLA_COMPLEX_PTR( base );
50  scomplex *buff_exp = ( scomplex * ) FLA_COMPLEX_PTR( exp );
51  scomplex *buff_btoe = ( scomplex * ) FLA_COMPLEX_PTR( btoe );
52 
53  buff_btoe->real = ( float ) pow( buff_base->real, buff_exp->real );
54  buff_btoe->imag = 0.0;
55 
56  break;
57  }
58 
59  case FLA_DOUBLE_COMPLEX:
60  {
61  dcomplex *buff_base = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( base );
62  dcomplex *buff_exp = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( exp );
63  dcomplex *buff_btoe = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( btoe );
64 
65  buff_btoe->real = ( double ) pow( buff_base->real, buff_exp->real );
66  buff_btoe->imag = 0.0;
67 
68  break;
69  }
70 
71  }
72 
73  return r_val;
74 }
float real
Definition: blis_type_defs.h:134
double imag
Definition: blis_type_defs.h:139
double real
Definition: blis_type_defs.h:139
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
Definition: blis_type_defs.h:132
FLA_Error FLA_Pow_check(FLA_Obj base, FLA_Obj exp, FLA_Obj btoe)
Definition: FLA_Pow.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
float imag
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:137

◆ FLA_Pow_check()

FLA_Error FLA_Pow_check ( FLA_Obj  base,
FLA_Obj  exp,
FLA_Obj  btoe 
)

References FLA_Check_floating_object(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().

Referenced by FLA_Pow().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( base );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( exp );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_floating_object( btoe );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_if_scalar( base );
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_if_scalar( exp );
30  FLA_Check_error_code( e_val );
31 
32  e_val = FLA_Check_if_scalar( btoe );
33  FLA_Check_error_code( e_val );
34 
35  e_val = FLA_Check_nonconstant_object( btoe );
36  FLA_Check_error_code( e_val );
37 
38  return FLA_SUCCESS;
39 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373

◆ FLA_random_dcomplex()

dcomplex FLA_random_dcomplex ( void  )

References FLA_random_double(), dcomplex::imag, and dcomplex::real.

34 {
35  dcomplex z;
36 
37  z.real = FLA_random_double();
38  z.imag = FLA_random_double();
39 
40  return z;
41 }
double imag
Definition: blis_type_defs.h:139
double FLA_random_double()
Definition: FLA_random_number.c:18
double real
Definition: blis_type_defs.h:139
Definition: blis_type_defs.h:137

◆ FLA_random_double()

double FLA_random_double ( void  )

Referenced by FLA_random_dcomplex().

19 {
20  return ( ( double ) rand() / ( double ) RAND_MAX ) * 2.0 - 1.0;
21 }

◆ FLA_random_float()

float FLA_random_float ( void  )

Referenced by FLA_random_scomplex().

14 {
15  return ( float )( ( ( double ) rand() / ( double ) RAND_MAX ) * 2.0 - 1.0 );
16 }

◆ FLA_Random_herm_matrix()

FLA_Error FLA_Random_herm_matrix ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References FLA_Check_error_level(), FLA_Hermitianize(), FLA_Random_herm_matrix_check(), and FLA_Random_tri_matrix().

14 {
15  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
17 
18  FLA_Random_tri_matrix( uplo, FLA_NONUNIT_DIAG, A );
19 
20  FLA_Hermitianize( uplo, A );
21 
22  return FLA_SUCCESS;
23 }
FLA_Error FLA_Hermitianize(FLA_Uplo uplo, FLA_Obj A)
Definition: FLA_Hermitianize.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
FLA_Error FLA_Random_herm_matrix_check(FLA_Uplo uplo, FLA_Obj A)
Definition: FLA_Random_herm_matrix_check.c:13
FLA_Error FLA_Random_tri_matrix(FLA_Uplo uplo, FLA_Diag diag, FLA_Obj A)
Definition: FLA_Random_tri_matrix.c:13

◆ FLA_Random_herm_matrix_check()

FLA_Error FLA_Random_herm_matrix_check ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_square(), and FLA_Check_valid_uplo().

Referenced by FLA_Random_herm_matrix().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_uplo( uplo );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( A );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_square( A );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_square(FLA_Obj A)
Definition: FLA_Check.c:363
FLA_Error FLA_Check_valid_uplo(FLA_Uplo uplo)
Definition: FLA_Check.c:76

◆ FLA_Random_matrix()

FLA_Error FLA_Random_matrix ( FLA_Obj  A)

References bl1_crandm(), bl1_drandm(), bl1_srandm(), bl1_zrandm(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Random_matrix_check().

Referenced by FLA_Fill_with_random_dist(), FLA_Random_unitary_matrix(), and FLASH_Random_matrix().

14 {
15  FLA_Datatype datatype;
16  int m_A, n_A;
17  int rs_A, cs_A;
18 
19  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
21 
22  datatype = FLA_Obj_datatype( A );
23 
24  m_A = FLA_Obj_length( A );
25  n_A = FLA_Obj_width( A );
26  rs_A = FLA_Obj_row_stride( A );
27  cs_A = FLA_Obj_col_stride( A );
28 
29 
30  switch( datatype ){
31 
32  case FLA_FLOAT:
33  {
34  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
35 
36  bl1_srandm( m_A,
37  n_A,
38  buff_A, rs_A, cs_A );
39 
40  break;
41  }
42 
43  case FLA_DOUBLE:
44  {
45  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
46 
47  bl1_drandm( m_A,
48  n_A,
49  buff_A, rs_A, cs_A );
50 
51  break;
52  }
53 
54  case FLA_COMPLEX:
55  {
56  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
57 
58  bl1_crandm( m_A,
59  n_A,
60  buff_A, rs_A, cs_A );
61 
62  break;
63  }
64 
65  case FLA_DOUBLE_COMPLEX:
66  {
67  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
68 
69  bl1_zrandm( m_A,
70  n_A,
71  buff_A, rs_A, cs_A );
72 
73  break;
74  }
75 
76  }
77 
78  return FLA_SUCCESS;
79 }
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
FLA_Error FLA_Random_matrix_check(FLA_Obj A)
Definition: FLA_Random_matrix_check.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void bl1_srandm(int m, int n, float *a, int a_rs, int a_cs)
Definition: bl1_randm.c:13
void bl1_crandm(int m, int n, scomplex *a, int a_rs, int a_cs)
Definition: bl1_randm.c:81
Definition: blis_type_defs.h:132
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
void bl1_zrandm(int m, int n, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_randm.c:115
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
void bl1_drandm(int m, int n, double *a, int a_rs, int a_cs)
Definition: bl1_randm.c:47
Definition: blis_type_defs.h:137

◆ FLA_Random_matrix_check()

FLA_Error FLA_Random_matrix_check ( FLA_Obj  A)

References FLA_Check_floating_object(), and FLA_Check_nonconstant_object().

Referenced by FLA_Random_matrix().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( A );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( A );
21  FLA_Check_error_code( e_val );
22 
23  return FLA_SUCCESS;
24 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232

◆ FLA_random_scomplex()

scomplex FLA_random_scomplex ( void  )

References FLA_random_float(), scomplex::imag, and scomplex::real.

24 {
25  scomplex z;
26 
27  z.real = FLA_random_float();
28  z.imag = FLA_random_float();
29 
30  return z;
31 }
float real
Definition: blis_type_defs.h:134
Definition: blis_type_defs.h:132
float imag
Definition: blis_type_defs.h:134
float FLA_random_float()
Definition: FLA_random_number.c:13

◆ FLA_Random_spd_matrix()

FLA_Error FLA_Random_spd_matrix ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References FLA_Check_error_level(), FLA_Herk_external(), FLA_Obj_create_conf_to(), FLA_Obj_free(), FLA_ONE, FLA_Random_spd_matrix_check(), FLA_Random_tri_matrix(), and FLA_ZERO.

Referenced by FLASH_Random_spd_matrix().

14 {
15  FLA_Obj R;
16 
17  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
18  FLA_Random_spd_matrix_check( uplo, A );
19 
20  // Create a temporary object R conformal to A.
21  FLA_Obj_create_conf_to( FLA_NO_TRANSPOSE, A, &R );
22 
23  // Randomize R to be an uplo-triangular matrix. Note that the diagonal of R
24  // needs to be positive to ensure that R * R' is SPD/HPD.
25  FLA_Random_tri_matrix( uplo, FLA_NONUNIT_DIAG, R );
26 
27  if ( uplo == FLA_LOWER_TRIANGULAR )
28  {
29  // A = R * R';
30  FLA_Herk_external( uplo, FLA_NO_TRANSPOSE, FLA_ONE, R, FLA_ZERO, A );
31  }
32  else // if ( uplo == FLA_UPPER_TRIANGULAR )
33  {
34  // A = R' * R;
35  FLA_Herk_external( uplo, FLA_CONJ_TRANSPOSE, FLA_ONE, R, FLA_ZERO, A );
36  }
37 
38  // Free R.
39  FLA_Obj_free( &R );
40 
41  return FLA_SUCCESS;
42 }
FLA_Error FLA_Herk_external(FLA_Uplo uplo, FLA_Trans trans, FLA_Obj alpha, FLA_Obj A, FLA_Obj beta, FLA_Obj C)
Definition: FLA_Herk_external.c:13
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition: FLA_Obj.c:588
FLA_Obj FLA_ONE
Definition: FLA_Init.c:18
Definition: FLA_type_defs.h:158
FLA_Error FLA_Obj_create_conf_to(FLA_Trans trans, FLA_Obj old, FLA_Obj *obj)
Definition: FLA_Obj.c:286
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
FLA_Error FLA_Random_spd_matrix_check(FLA_Uplo uplo, FLA_Obj A)
Definition: FLA_Random_spd_matrix_check.c:13
FLA_Error FLA_Random_tri_matrix(FLA_Uplo uplo, FLA_Diag diag, FLA_Obj A)
Definition: FLA_Random_tri_matrix.c:13
FLA_Obj FLA_ZERO
Definition: FLA_Init.c:20

◆ FLA_Random_spd_matrix_check()

FLA_Error FLA_Random_spd_matrix_check ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_square(), and FLA_Check_valid_uplo().

Referenced by FLA_Random_spd_matrix().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_uplo( uplo );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( A );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_square( A );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_square(FLA_Obj A)
Definition: FLA_Check.c:363
FLA_Error FLA_Check_valid_uplo(FLA_Uplo uplo)
Definition: FLA_Check.c:76

◆ FLA_Random_symm_matrix()

FLA_Error FLA_Random_symm_matrix ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References FLA_Check_error_level(), FLA_Random_symm_matrix_check(), FLA_Random_tri_matrix(), and FLA_Symmetrize().

14 {
15  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
17 
18  FLA_Random_tri_matrix( uplo, FLA_NONUNIT_DIAG, A );
19 
20  FLA_Symmetrize( uplo, A );
21 
22  return FLA_SUCCESS;
23 }
FLA_Error FLA_Symmetrize(FLA_Uplo uplo, FLA_Obj A)
Definition: FLA_Symmetrize.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
FLA_Error FLA_Random_tri_matrix(FLA_Uplo uplo, FLA_Diag diag, FLA_Obj A)
Definition: FLA_Random_tri_matrix.c:13
FLA_Error FLA_Random_symm_matrix_check(FLA_Uplo uplo, FLA_Obj A)
Definition: FLA_Random_symm_matrix_check.c:13

◆ FLA_Random_symm_matrix_check()

FLA_Error FLA_Random_symm_matrix_check ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_square(), and FLA_Check_valid_uplo().

Referenced by FLA_Random_symm_matrix().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_uplo( uplo );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( A );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_square( A );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_square(FLA_Obj A)
Definition: FLA_Check.c:363
FLA_Error FLA_Check_valid_uplo(FLA_Uplo uplo)
Definition: FLA_Check.c:76

◆ FLA_Random_tri_matrix()

FLA_Error FLA_Random_tri_matrix ( FLA_Uplo  uplo,
FLA_Diag  diag,
FLA_Obj  A 
)

References bl1_crandmr(), bl1_drandmr(), bl1_srandmr(), bl1_zrandmr(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_diag(), FLA_Param_map_flame_to_blis_uplo(), and FLA_Random_tri_matrix_check().

Referenced by FLA_Random_herm_matrix(), FLA_Random_spd_matrix(), and FLA_Random_symm_matrix().

14 {
15  FLA_Datatype datatype;
16  int m_A, n_A;
17  int rs_A, cs_A;
18  uplo1_t blis_uplo;
19  diag1_t blis_diag;
20 
21  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
22  FLA_Random_tri_matrix_check( uplo, diag, A );
23 
24  datatype = FLA_Obj_datatype( A );
25 
26  m_A = FLA_Obj_length( A );
27  n_A = FLA_Obj_width( A );
28  rs_A = FLA_Obj_row_stride( A );
29  cs_A = FLA_Obj_col_stride( A );
30 
31  FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo );
32  FLA_Param_map_flame_to_blis_diag( diag, &blis_diag );
33 
34 
35  switch( datatype ){
36 
37  case FLA_FLOAT:
38  {
39  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
40 
41  bl1_srandmr( blis_uplo,
42  blis_diag,
43  m_A,
44  n_A,
45  buff_A, rs_A, cs_A );
46 
47  break;
48  }
49 
50  case FLA_DOUBLE:
51  {
52  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
53 
54  bl1_drandmr( blis_uplo,
55  blis_diag,
56  m_A,
57  n_A,
58  buff_A, rs_A, cs_A );
59 
60  break;
61  }
62 
63  case FLA_COMPLEX:
64  {
65  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
66 
67  bl1_crandmr( blis_uplo,
68  blis_diag,
69  m_A,
70  n_A,
71  buff_A, rs_A, cs_A );
72 
73  break;
74  }
75 
76  case FLA_DOUBLE_COMPLEX:
77  {
78  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
79 
80  bl1_zrandmr( blis_uplo,
81  blis_diag,
82  m_A,
83  n_A,
84  buff_A, rs_A, cs_A );
85 
86  break;
87  }
88 
89  }
90 
91  return FLA_SUCCESS;
92 }
uplo1_t
Definition: blis_type_defs.h:60
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
FLA_Error FLA_Random_tri_matrix_check(FLA_Uplo uplo, FLA_Diag diag, FLA_Obj A)
Definition: FLA_Random_tri_matrix_check.c:13
diag1_t
Definition: blis_type_defs.h:72
void FLA_Param_map_flame_to_blis_diag(FLA_Diag diag, diag1_t *blis_diag)
Definition: FLA_Param.c:317
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void FLA_Param_map_flame_to_blis_uplo(FLA_Uplo uplo, uplo1_t *blis_uplo)
Definition: FLA_Param.c:285
Definition: blis_type_defs.h:132
void bl1_drandmr(uplo1_t uplo, diag1_t diag, int m, int n, double *a, int a_rs, int a_cs)
Definition: bl1_randmr.c:134
void bl1_crandmr(uplo1_t uplo, diag1_t diag, int m, int n, scomplex *a, int a_rs, int a_cs)
Definition: bl1_randmr.c:255
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
void bl1_zrandmr(uplo1_t uplo, diag1_t diag, int m, int n, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_randmr.c:377
void bl1_srandmr(uplo1_t uplo, diag1_t diag, int m, int n, float *a, int a_rs, int a_cs)
Definition: bl1_randmr.c:13
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
Definition: blis_type_defs.h:137

◆ FLA_Random_tri_matrix_check()

FLA_Error FLA_Random_tri_matrix_check ( FLA_Uplo  uplo,
FLA_Diag  diag,
FLA_Obj  A 
)

References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_valid_diag(), and FLA_Check_valid_uplo().

Referenced by FLA_Random_tri_matrix().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_uplo( uplo );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_valid_diag( diag );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_floating_object( A );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_nonconstant_object( A );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
FLA_Error FLA_Check_valid_diag(FLA_Diag diag)
Definition: FLA_Check.c:100
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_valid_uplo(FLA_Uplo uplo)
Definition: FLA_Check.c:76

◆ FLA_Random_unitary_matrix()

FLA_Error FLA_Random_unitary_matrix ( FLA_Obj  A)

References FLA_Check_error_level(), FLA_Obj_create_conf_to(), FLA_Obj_free(), FLA_QR_UT(), FLA_QR_UT_create_T(), FLA_QR_UT_form_Q(), FLA_Random_matrix(), and FLA_Random_unitary_matrix_check().

14 {
15  FLA_Obj B, T;
16 
17  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
19 
20  FLA_Obj_create_conf_to( FLA_NO_TRANSPOSE, A, &B );
21 
22  FLA_Random_matrix( B );
23 
24  FLA_QR_UT_create_T( B, &T );
25 
26  FLA_QR_UT( B, T );
27 
28  FLA_QR_UT_form_Q( B, T, A );
29  //FLA_Apply_Q_UT_create_workspace( A, T, &W );
30  //FLA_Apply_Q_UT( FLA_LEFT, FLA_NO_TRANSPOSE, FLA_FORWARD, FLA_COLUMNWISE, B, T, W, A );
31 
32  //FLA_Obj_free( &W );
33  FLA_Obj_free( &T );
34  FLA_Obj_free( &B );
35 
36 /*
37  FLA_Datatype datatype;
38  FLA_Obj v, tau;
39  FLA_Obj aT,
40  AB;
41  int i, mn;
42  int k;
43 
44  datatype = FLA_Obj_datatype( A );
45  mn = FLA_Obj_length( A );
46  k = 1;
47 
48  FLA_Obj_create( datatype, mn-1, 1, 0, 0, &v );
49  FLA_Obj_create( datatype, 1, 1, 0, 0, &tau );
50 
51  FLA_Obj_set_to_identity( A );
52 
53  FLA_Part_2x1( A, &aT,
54  &AB, 1, FLA_TOP );
55 
56  for ( i = 0; i < k; ++i )
57  {
58  FLA_Random_matrix( tau );
59  FLA_Random_matrix( v );
60 
61  FLA_Apply_H2_UT( FLA_LEFT, tau, v, aT,
62  AB );
63  }
64 
65  FLA_Obj_free( &tau );
66  FLA_Obj_free( &v );
67 */
68 
69  return FLA_SUCCESS;
70 }
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition: FLA_Obj.c:588
FLA_Error FLA_Random_unitary_matrix_check(FLA_Obj A)
Definition: FLA_Random_unitary_matrix_check.c:13
FLA_Error FLA_QR_UT_create_T(FLA_Obj A, FLA_Obj *T)
Definition: FLA_QR_UT_create_T.c:13
FLA_Error FLA_Random_matrix(FLA_Obj A)
Definition: FLA_Random_matrix.c:13
Definition: FLA_type_defs.h:158
FLA_Error FLA_QR_UT(FLA_Obj A, FLA_Obj T)
Definition: FLA_QR_UT.c:15
FLA_Error FLA_QR_UT_form_Q(FLA_Obj A, FLA_Obj T, FLA_Obj Q)
Definition: FLA_QR_UT_form_Q.c:13
FLA_Error FLA_Obj_create_conf_to(FLA_Trans trans, FLA_Obj old, FLA_Obj *obj)
Definition: FLA_Obj.c:286
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18

◆ FLA_Random_unitary_matrix_check()

FLA_Error FLA_Random_unitary_matrix_check ( FLA_Obj  A)

References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), and FLA_Check_square().

Referenced by FLA_Random_unitary_matrix().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( A );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_square( A );
24  FLA_Check_error_code( e_val );
25 
26  return FLA_SUCCESS;
27 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_square(FLA_Obj A)
Definition: FLA_Check.c:363

◆ FLA_Scal_elemwise()

FLA_Error FLA_Scal_elemwise ( FLA_Trans  trans,
FLA_Obj  A,
FLA_Obj  B 
)

References bl1_cewscalmt(), bl1_dewscalmt(), bl1_sewscalmt(), bl1_zewscalmt(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_trans(), and FLA_Scal_elemwise_check().

14 {
15  FLA_Datatype datatype;
16  int m_B, n_B;
17  int rs_A, cs_A;
18  int rs_B, cs_B;
19  trans1_t blis_trans;
20 
21  if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
22  FLA_Scal_elemwise_check( trans, A, B );
23 
24  if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS;
25 
26  datatype = FLA_Obj_datatype( A );
27 
28  rs_A = FLA_Obj_row_stride( A );
29  cs_A = FLA_Obj_col_stride( A );
30 
31  m_B = FLA_Obj_length( B );
32  n_B = FLA_Obj_width( B );
33  rs_B = FLA_Obj_row_stride( B );
34  cs_B = FLA_Obj_col_stride( B );
35 
36  FLA_Param_map_flame_to_blis_trans( trans, &blis_trans );
37 
38  switch ( datatype ){
39 
40  case FLA_FLOAT:
41  {
42  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
43  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
44 
45  bl1_sewscalmt( blis_trans,
46  m_B,
47  n_B,
48  buff_A, rs_A, cs_A,
49  buff_B, rs_B, cs_B );
50 
51  break;
52  }
53 
54  case FLA_DOUBLE:
55  {
56  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
57  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
58 
59  bl1_dewscalmt( blis_trans,
60  m_B,
61  n_B,
62  buff_A, rs_A, cs_A,
63  buff_B, rs_B, cs_B );
64 
65  break;
66  }
67 
68  case FLA_COMPLEX:
69  {
70  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
71  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
72 
73  bl1_cewscalmt( blis_trans,
74  m_B,
75  n_B,
76  buff_A, rs_A, cs_A,
77  buff_B, rs_B, cs_B );
78 
79  break;
80  }
81 
82  case FLA_DOUBLE_COMPLEX:
83  {
84  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
85  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
86 
87  bl1_zewscalmt( blis_trans,
88  m_B,
89  n_B,
90  buff_A, rs_A, cs_A,
91  buff_B, rs_B, cs_B );
92 
93  break;
94  }
95 
96  }
97 
98  return FLA_SUCCESS;
99 }
void bl1_dewscalmt(trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_ewscalmt.c:85
void FLA_Param_map_flame_to_blis_trans(FLA_Trans trans, trans1_t *blis_trans)
Definition: FLA_Param.c:245
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
void bl1_cewscalmt(trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_ewscalmt.c:229
trans1_t
Definition: blis_type_defs.h:52
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition: FLA_Query.c:400
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
Definition: blis_type_defs.h:132
void bl1_sewscalmt(trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_ewscalmt.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
void bl1_zewscalmt(trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_ewscalmt.c:373
FLA_Error FLA_Scal_elemwise_check(FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition: FLA_Scal_elemwise_check.c:13
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
Definition: blis_type_defs.h:137

◆ FLA_Scal_elemwise_check()

FLA_Error FLA_Scal_elemwise_check ( FLA_Trans  trans,
FLA_Obj  A,
FLA_Obj  B 
)

References FLA_Check_conformal_dims(), FLA_Check_floating_object(), FLA_Check_identical_object_datatype(), FLA_Check_nonconstant_object(), and FLA_Check_valid_trans().

Referenced by FLA_Scal_elemwise().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_trans( trans );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( A );
24  FLA_Check_error_code( e_val );
25 
27  FLA_Check_error_code( e_val );
28 
29  e_val = FLA_Check_conformal_dims( trans, A, B );
30  FLA_Check_error_code( e_val );
31 
32  return FLA_SUCCESS;
33 }
FLA_Error FLA_Check_identical_object_datatype(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:967
FLA_Error FLA_Check_valid_trans(FLA_Trans trans)
Definition: FLA_Check.c:87
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_conformal_dims(FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:393

◆ FLA_Scale_diag()

FLA_Error FLA_Scale_diag ( FLA_Conj  conj,
FLA_Obj  alpha,
FLA_Obj  A 
)

References bl1_cscalediag(), bl1_csscalediag(), bl1_dscalediag(), bl1_sscalediag(), bl1_zdscalediag(), bl1_zscalediag(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_conj(), and FLA_Scale_diag_check().

Referenced by FLA_UDdate_UT_unb_var1().

14 {
15  FLA_Datatype datatype_A;
16  FLA_Datatype datatype_alpha;
17  dim_t m_A, n_A;
18  dim_t rs_A, cs_A;
19  conj1_t blis_conj;
20 
21  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
22  FLA_Scale_diag_check( conj, alpha, A );
23 
24  datatype_A = FLA_Obj_datatype( A );
25  datatype_alpha = FLA_Obj_datatype( alpha );
26  m_A = FLA_Obj_length( A );
27  n_A = FLA_Obj_width( A );
28  rs_A = FLA_Obj_row_stride( A );
29  cs_A = FLA_Obj_col_stride( A );
30 
31  FLA_Param_map_flame_to_blis_conj( conj, &blis_conj );
32 
33  switch( datatype_A ){
34 
35  case FLA_FLOAT:
36  {
37  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
38  float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
39 
40  bl1_sscalediag( blis_conj,
41  0,
42  m_A,
43  n_A,
44  buff_alpha,
45  buff_A, rs_A, cs_A );
46 
47  break;
48  }
49  case FLA_DOUBLE:
50  {
51  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
52  double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
53 
54  bl1_dscalediag( blis_conj,
55  0,
56  m_A,
57  n_A,
58  buff_alpha,
59  buff_A, rs_A, cs_A );
60 
61  break;
62  }
63 
64  case FLA_COMPLEX:
65  {
66  if ( datatype_alpha == FLA_COMPLEX )
67  {
68  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
69  scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha );
70 
71  bl1_cscalediag( blis_conj,
72  0,
73  m_A,
74  n_A,
75  buff_alpha,
76  buff_A, rs_A, cs_A );
77  }
78  else
79  {
80  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
81  float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
82 
83  bl1_csscalediag( blis_conj,
84  0,
85  m_A,
86  n_A,
87  buff_alpha,
88  buff_A, rs_A, cs_A );
89  }
90 
91  break;
92  }
93 
94  case FLA_DOUBLE_COMPLEX:
95  {
96  if ( datatype_alpha == FLA_DOUBLE_COMPLEX )
97  {
98  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
99  dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha );
100 
101  bl1_zscalediag( blis_conj,
102  0,
103  m_A,
104  n_A,
105  buff_alpha,
106  buff_A, rs_A, cs_A );
107  }
108  else
109  {
110  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
111  double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
112 
113  bl1_zdscalediag( blis_conj,
114  0,
115  m_A,
116  n_A,
117  buff_alpha,
118  buff_A, rs_A, cs_A );
119  }
120 
121  break;
122  }
123 
124  }
125 
126  return FLA_SUCCESS;
127 }
unsigned long dim_t
Definition: FLA_type_defs.h:71
conj1_t
Definition: blis_type_defs.h:79
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
void bl1_dscalediag(conj1_t conj, int offset, int m, int n, double *sigma, double *a, int a_rs, int a_cs)
Definition: bl1_scalediag.c:34
void bl1_csscalediag(conj1_t conj, int offset, int m, int n, float *sigma, scomplex *a, int a_rs, int a_cs)
Definition: bl1_scalediag.c:55
void bl1_sscalediag(conj1_t conj, int offset, int m, int n, float *sigma, float *a, int a_rs, int a_cs)
Definition: bl1_scalediag.c:13
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
FLA_Error FLA_Scale_diag_check(FLA_Conj conj, FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Scale_diag_check.c:13
Definition: blis_type_defs.h:132
void bl1_zscalediag(conj1_t conj, int offset, int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_scalediag.c:123
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
void FLA_Param_map_flame_to_blis_conj(FLA_Conj conj, conj1_t *blis_conj)
Definition: FLA_Param.c:269
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
void bl1_cscalediag(conj1_t conj, int offset, int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
Definition: bl1_scalediag.c:99
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
void bl1_zdscalediag(conj1_t conj, int offset, int m, int n, double *sigma, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_scalediag.c:77
Definition: blis_type_defs.h:137

◆ FLA_Scale_diag_check()

FLA_Error FLA_Scale_diag_check ( FLA_Conj  conj,
FLA_Obj  alpha,
FLA_Obj  A 
)

References FLA_Check_consistent_object_datatype(), FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), FLA_Check_valid_conj(), and FLA_Obj_is_real().

Referenced by FLA_Scale_diag().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_conj( conj );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( A );
24  FLA_Check_error_code( e_val );
25 
26  if ( FLA_Obj_is_real( A ) )
27  {
28  e_val = FLA_Check_consistent_object_datatype( A, alpha );
29  FLA_Check_error_code( e_val );
30  }
31  else
32  {
33  e_val = FLA_Check_identical_object_precision( A, alpha );
34  FLA_Check_error_code( e_val );
35  }
36 
37  e_val = FLA_Check_if_scalar( alpha );
38  FLA_Check_error_code( e_val );
39 
40  return FLA_SUCCESS;
41 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:298
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_valid_conj(FLA_Conj conj)
Definition: FLA_Check.c:112
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373
FLA_Bool FLA_Obj_is_real(FLA_Obj A)
Definition: FLA_Query.c:307
FLA_Error FLA_Check_consistent_object_datatype(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:339

◆ FLA_Set()

FLA_Error FLA_Set ( FLA_Obj  alpha,
FLA_Obj  A 
)

References bl1_csetm(), bl1_dsetm(), bl1_isetm(), bl1_ssetm(), bl1_zsetm(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Set_check().

Referenced by FLA_Asum_external(), FLA_Bidiag_UT_form_U_ext(), FLA_Bidiag_UT_form_V_ext(), FLA_Bidiag_UT_l_realify_unb(), FLA_Bidiag_UT_realify(), FLA_Bidiag_UT_u_blf_var4(), FLA_Bidiag_UT_u_blk_var4(), FLA_Bidiag_UT_u_blk_var5(), FLA_Bidiag_UT_u_realify_unb(), FLA_Bidiag_UT_u_step_unb_var1(), FLA_Bidiag_UT_u_step_unb_var2(), FLA_Bidiag_UT_u_step_unb_var4(), FLA_Bidiag_UT_u_step_unb_var5(), FLA_Fill_with_cluster_dist(), FLA_Fill_with_geometric_dist(), FLA_Fill_with_inverse_dist(), FLA_Fill_with_linear_dist(), FLA_Fill_with_logarithmic_dist(), FLA_Fill_with_random_dist(), FLA_Hess_UT_blf_var2(), FLA_Hess_UT_blf_var3(), FLA_Hess_UT_blf_var4(), FLA_Hess_UT_blk_var1(), FLA_Hess_UT_blk_var2(), FLA_Hess_UT_blk_var3(), FLA_Hess_UT_blk_var4(), FLA_Hess_UT_step_unb_var1(), FLA_Hess_UT_step_unb_var2(), FLA_Hess_UT_step_unb_var3(), FLA_Hess_UT_step_unb_var4(), FLA_Hess_UT_step_unb_var5(), FLA_Hevd_lv_unb_var1(), FLA_Hevd_lv_unb_var2(), FLA_LQ_UT_solve(), FLA_Nrm2_external(), FLA_Obj_create_buffer_task(), FLA_QR_UT_piv(), FLA_QR_UT_piv_unb_var1(), FLA_QR_UT_piv_unb_var2(), FLA_Scal_external(), FLA_Scalc_external(), FLA_Set_to_identity(), FLA_Sylv_unb_external(), FLA_Tridiag_UT_form_Q(), FLA_Tridiag_UT_l_blf_var3(), FLA_Tridiag_UT_l_blk_var3(), FLA_Tridiag_UT_l_realify_unb(), FLA_Tridiag_UT_l_step_unb_var1(), FLA_Tridiag_UT_l_step_unb_var2(), FLA_Tridiag_UT_l_step_unb_var3(), FLA_Tridiag_UT_realify(), FLA_Tridiag_UT_u_realify_unb(), FLASH_Norm1(), and FLASH_Set().

14 {
15  FLA_Datatype datatype;
16  dim_t m_A, n_A;
17  dim_t rs_A, cs_A;
18 
19  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
20  FLA_Set_check( alpha, A );
21 
22  datatype = FLA_Obj_datatype( A );
23  m_A = FLA_Obj_length( A );
24  n_A = FLA_Obj_width( A );
25  rs_A = FLA_Obj_row_stride( A );
26  cs_A = FLA_Obj_col_stride( A );
27 
28  switch ( datatype ){
29 
30  case FLA_INT:
31  {
32  int *buff_A = ( int * ) FLA_INT_PTR( A );
33  int *buff_alpha = ( int * ) FLA_INT_PTR( alpha );
34 
35  bl1_isetm( m_A,
36  n_A,
37  buff_alpha,
38  buff_A, rs_A, cs_A );
39 
40  break;
41  }
42 
43  case FLA_FLOAT:
44  {
45  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
46  float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
47 
48  bl1_ssetm( m_A,
49  n_A,
50  buff_alpha,
51  buff_A, rs_A, cs_A );
52 
53  break;
54  }
55 
56  case FLA_DOUBLE:
57  {
58  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
59  double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
60 
61  bl1_dsetm( m_A,
62  n_A,
63  buff_alpha,
64  buff_A, rs_A, cs_A );
65 
66  break;
67  }
68 
69  case FLA_COMPLEX:
70  {
71  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
72  scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha );
73 
74  bl1_csetm( m_A,
75  n_A,
76  buff_alpha,
77  buff_A, rs_A, cs_A );
78 
79  break;
80  }
81 
82  case FLA_DOUBLE_COMPLEX:
83  {
84  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
85  dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha );
86 
87  bl1_zsetm( m_A,
88  n_A,
89  buff_alpha,
90  buff_A, rs_A, cs_A );
91 
92  break;
93  }
94 
95  }
96 
97  return FLA_SUCCESS;
98 }
FLA_Error FLA_Set_check(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Set_check.c:13
unsigned long dim_t
Definition: FLA_type_defs.h:71
void bl1_dsetm(int m, int n, double *sigma, double *a, int a_rs, int a_cs)
Definition: bl1_setm.c:45
void bl1_csetm(int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
Definition: bl1_setm.c:61
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
Definition: blis_type_defs.h:132
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
void bl1_zsetm(int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_setm.c:78
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
void bl1_isetm(int m, int n, int *sigma, int *a, int a_rs, int a_cs)
Definition: bl1_setm.c:13
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
Definition: blis_type_defs.h:137
void bl1_ssetm(int m, int n, float *sigma, float *a, int a_rs, int a_cs)
Definition: bl1_setm.c:29

◆ FLA_Set_check()

FLA_Error FLA_Set_check ( FLA_Obj  alpha,
FLA_Obj  A 
)

References FLA_Check_consistent_object_datatype(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), and FLA_Check_valid_object_datatype().

Referenced by FLA_Set().

14 {
15  FLA_Error e_val;
16 
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_consistent_object_datatype( A, alpha );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_if_scalar( alpha );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_valid_object_datatype(FLA_Obj A)
Definition: FLA_Check.c:171
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373
FLA_Error FLA_Check_consistent_object_datatype(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:339

◆ FLA_Set_diag()

FLA_Error FLA_Set_diag ( FLA_Obj  alpha,
FLA_Obj  A 
)

References bl1_csetdiag(), bl1_dsetdiag(), bl1_isetdiag(), bl1_ssetdiag(), bl1_zsetdiag(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Set_diag_check().

Referenced by FLA_QR_UT_form_Q(), and FLA_Set_to_identity().

14 {
15  FLA_Datatype datatype;
16  int m_A, n_A;
17  int rs_A, cs_A;
18 
19  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
20  FLA_Set_diag_check( alpha, A );
21 
22  datatype = FLA_Obj_datatype( A );
23  m_A = FLA_Obj_length( A );
24  n_A = FLA_Obj_width( A );
25  rs_A = FLA_Obj_row_stride( A );
26  cs_A = FLA_Obj_col_stride( A );
27 
28  switch ( datatype ){
29 
30  case FLA_INT:
31  {
32  int *buff_A = ( int * ) FLA_INT_PTR( A );
33  int *buff_alpha = ( int * ) FLA_INT_PTR( alpha );
34 
35  bl1_isetdiag( 0,
36  m_A,
37  n_A,
38  buff_alpha,
39  buff_A, rs_A, cs_A );
40 
41  break;
42  }
43 
44  case FLA_FLOAT:
45  {
46  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
47  float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
48 
49  bl1_ssetdiag( 0,
50  m_A,
51  n_A,
52  buff_alpha,
53  buff_A, rs_A, cs_A );
54 
55  break;
56  }
57 
58  case FLA_DOUBLE:
59  {
60  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
61  double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
62 
63  bl1_dsetdiag( 0,
64  m_A,
65  n_A,
66  buff_alpha,
67  buff_A, rs_A, cs_A );
68 
69  break;
70  }
71 
72  case FLA_COMPLEX:
73  {
74  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
75  scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha );
76 
77  bl1_csetdiag( 0,
78  m_A,
79  n_A,
80  buff_alpha,
81  buff_A, rs_A, cs_A );
82 
83  break;
84  }
85 
86  case FLA_DOUBLE_COMPLEX:
87  {
88  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
89  dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha );
90 
91  bl1_zsetdiag( 0,
92  m_A,
93  n_A,
94  buff_alpha,
95  buff_A, rs_A, cs_A );
96 
97  break;
98  }
99 
100  }
101 
102  return FLA_SUCCESS;
103 }
void bl1_ssetdiag(int offset, int m, int n, float *sigma, float *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:34
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
void bl1_dsetdiag(int offset, int m, int n, double *sigma, double *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:55
void bl1_zsetdiag(int offset, int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:98
FLA_Error FLA_Set_diag_check(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Set_diag_check.c:13
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
Definition: blis_type_defs.h:132
void bl1_isetdiag(int offset, int m, int n, int *sigma, int *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
void bl1_csetdiag(int offset, int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:76
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
Definition: blis_type_defs.h:137

◆ FLA_Set_diag_check()

FLA_Error FLA_Set_diag_check ( FLA_Obj  alpha,
FLA_Obj  A 
)

References FLA_Check_consistent_object_datatype(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), and FLA_Check_valid_object_datatype().

Referenced by FLA_Set_diag().

14 {
15  FLA_Error e_val;
16 
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_consistent_object_datatype( A, alpha );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_if_scalar( alpha );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_valid_object_datatype(FLA_Obj A)
Definition: FLA_Check.c:171
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373
FLA_Error FLA_Check_consistent_object_datatype(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:339

◆ FLA_Set_diagonal_matrix()

FLA_Error FLA_Set_diagonal_matrix ( FLA_Obj  d,
FLA_Obj  A 
)

References FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_min_dim(), FLA_Obj_row_stride(), FLA_Obj_vector_inc(), and i.

72 {
73  FLA_Datatype datatype;
74  int i, m;
75  int rs_A, cs_A;
76  int inc_d;
77 
78  datatype = FLA_Obj_datatype( A );
79 
80  m = FLA_Obj_min_dim( A );
81 
82  rs_A = FLA_Obj_row_stride( A );
83  cs_A = FLA_Obj_col_stride( A );
84 
85  inc_d = FLA_Obj_vector_inc( d );
86 
87  switch ( datatype )
88  {
89  case FLA_FLOAT:
90  {
91  FLA_OBJ_SET_DIAGONAL_VECTOR( float, FLA_FLOAT_PTR, delta_to_alpha, m );
92  break;
93  }
94  case FLA_DOUBLE:
95  {
96  FLA_OBJ_SET_DIAGONAL_VECTOR( double, FLA_DOUBLE_PTR, delta_to_alpha, m );
97  break;
98  }
99 
100  case FLA_COMPLEX:
101  {
102  FLA_OBJ_SET_DIAGONAL_VECTOR( scomplex, FLA_COMPLEX_PTR, delta_to_alpha, m );
103  break;
104  }
105 
106  case FLA_DOUBLE_COMPLEX:
107  {
108  FLA_OBJ_SET_DIAGONAL_VECTOR( dcomplex, FLA_DOUBLE_COMPLEX_PTR, delta_to_alpha, m );
109  break;
110  }
111  }
112  return FLA_SUCCESS;
113 }
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
Definition: blis_type_defs.h:132
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
int i
Definition: bl1_axmyv2.c:145
dim_t FLA_Obj_vector_inc(FLA_Obj obj)
Definition: FLA_Query.c:145
Definition: blis_type_defs.h:137
dim_t FLA_Obj_min_dim(FLA_Obj obj)
Definition: FLA_Query.c:153

◆ FLA_Set_diagonal_vector()

FLA_Error FLA_Set_diagonal_vector ( FLA_Obj  A,
FLA_Obj  d 
)

References FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_min_dim(), FLA_Obj_row_stride(), FLA_Obj_vector_inc(), and i.

28 {
29  FLA_Datatype datatype;
30  int i, m;
31  int rs_A, cs_A;
32  int inc_d;
33 
34  datatype = FLA_Obj_datatype( A );
35 
36  m = FLA_Obj_min_dim( A );
37 
38  rs_A = FLA_Obj_row_stride( A );
39  cs_A = FLA_Obj_col_stride( A );
40 
41  inc_d = FLA_Obj_vector_inc( d );
42 
43  switch ( datatype )
44  {
45  case FLA_FLOAT:
46  {
47  FLA_OBJ_SET_DIAGONAL_VECTOR( float, FLA_FLOAT_PTR, alpha_to_delta, m );
48  break;
49  }
50  case FLA_DOUBLE:
51  {
52  FLA_OBJ_SET_DIAGONAL_VECTOR( double, FLA_DOUBLE_PTR, alpha_to_delta, m );
53  break;
54  }
55 
56  case FLA_COMPLEX:
57  {
58  FLA_OBJ_SET_DIAGONAL_VECTOR( scomplex, FLA_COMPLEX_PTR, alpha_to_delta, m );
59  break;
60  }
61 
62  case FLA_DOUBLE_COMPLEX:
63  {
64  FLA_OBJ_SET_DIAGONAL_VECTOR( dcomplex, FLA_DOUBLE_COMPLEX_PTR, alpha_to_delta, m );
65  break;
66  }
67  }
68  return FLA_SUCCESS;
69 }
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
Definition: blis_type_defs.h:132
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
int i
Definition: bl1_axmyv2.c:145
dim_t FLA_Obj_vector_inc(FLA_Obj obj)
Definition: FLA_Query.c:145
Definition: blis_type_defs.h:137
dim_t FLA_Obj_min_dim(FLA_Obj obj)
Definition: FLA_Query.c:153

◆ FLA_Set_offdiag()

FLA_Error FLA_Set_offdiag ( int  offset,
FLA_Obj  alpha,
FLA_Obj  A 
)

References bl1_csetdiag(), bl1_dsetdiag(), bl1_isetdiag(), bl1_ssetdiag(), bl1_zsetdiag(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), and FLA_Obj_width().

14 {
15  FLA_Datatype datatype;
16  int m_A, n_A;
17  int rs_A, cs_A;
18 
19  //if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
20  // FLA_Set_diag_check( alpha, A );
21 
22  datatype = FLA_Obj_datatype( A );
23  m_A = FLA_Obj_length( A );
24  n_A = FLA_Obj_width( A );
25  rs_A = FLA_Obj_row_stride( A );
26  cs_A = FLA_Obj_col_stride( A );
27 
28  switch ( datatype ){
29 
30  case FLA_INT:
31  {
32  int *buff_A = ( int * ) FLA_INT_PTR( A );
33  int *buff_alpha = ( int * ) FLA_INT_PTR( alpha );
34 
35  bl1_isetdiag( offset,
36  m_A,
37  n_A,
38  buff_alpha,
39  buff_A, rs_A, cs_A );
40 
41  break;
42  }
43 
44  case FLA_FLOAT:
45  {
46  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
47  float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
48 
49  bl1_ssetdiag( offset,
50  m_A,
51  n_A,
52  buff_alpha,
53  buff_A, rs_A, cs_A );
54 
55  break;
56  }
57 
58  case FLA_DOUBLE:
59  {
60  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
61  double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
62 
63  bl1_dsetdiag( offset,
64  m_A,
65  n_A,
66  buff_alpha,
67  buff_A, rs_A, cs_A );
68 
69  break;
70  }
71 
72  case FLA_COMPLEX:
73  {
74  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
75  scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha );
76 
77  bl1_csetdiag( offset,
78  m_A,
79  n_A,
80  buff_alpha,
81  buff_A, rs_A, cs_A );
82 
83  break;
84  }
85 
86  case FLA_DOUBLE_COMPLEX:
87  {
88  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
89  dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha );
90 
91  bl1_zsetdiag( offset,
92  m_A,
93  n_A,
94  buff_alpha,
95  buff_A, rs_A, cs_A );
96 
97  break;
98  }
99 
100  }
101 
102  return FLA_SUCCESS;
103 }
void bl1_ssetdiag(int offset, int m, int n, float *sigma, float *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:34
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
void bl1_dsetdiag(int offset, int m, int n, double *sigma, double *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:55
void bl1_zsetdiag(int offset, int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:98
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
Definition: blis_type_defs.h:132
void bl1_isetdiag(int offset, int m, int n, int *sigma, int *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:13
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
void bl1_csetdiag(int offset, int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:76
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
Definition: blis_type_defs.h:137

◆ FLA_Set_to_identity()

FLA_Error FLA_Set_to_identity ( FLA_Obj  A)

References FLA_Check_error_level(), FLA_ONE, FLA_Set(), FLA_Set_diag(), FLA_Set_to_identity_check(), and FLA_ZERO.

Referenced by FLA_Form_perm_matrix(), FLA_QR_UT_form_Q(), FLA_Svd_uv_unb_var2(), and FLA_UDdate_UT_unb_var1().

14 {
15  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
17 
18  FLA_Set( FLA_ZERO, A );
19 
20  FLA_Set_diag( FLA_ONE, A );
21 
22  return FLA_SUCCESS;
23 }
FLA_Error FLA_Set_to_identity_check(FLA_Obj A)
Definition: FLA_Set_to_identity_check.c:13
FLA_Obj FLA_ONE
Definition: FLA_Init.c:18
FLA_Error FLA_Set(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Set.c:13
FLA_Error FLA_Set_diag(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Set_diag.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
FLA_Obj FLA_ZERO
Definition: FLA_Init.c:20

◆ FLA_Set_to_identity_check()

FLA_Error FLA_Set_to_identity_check ( FLA_Obj  A)

References FLA_Check_nonconstant_object(), and FLA_Check_valid_object_datatype().

Referenced by FLA_Set_to_identity().

14 {
15  FLA_Error e_val;
16 
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( A );
21  FLA_Check_error_code( e_val );
22 
23  return FLA_SUCCESS;
24 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_valid_object_datatype(FLA_Obj A)
Definition: FLA_Check.c:171

◆ FLA_Setr()

FLA_Error FLA_Setr ( FLA_Uplo  uplo,
FLA_Obj  alpha,
FLA_Obj  A 
)

References bl1_csetmr(), bl1_dsetmr(), bl1_ssetmr(), bl1_zsetmr(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_uplo(), and FLA_Setr_check().

Referenced by FLA_QR_UT_form_Q(), FLA_Svd_ext_u_unb_var1(), FLA_Svd_uv_unb_var1(), and FLA_Svd_uv_unb_var2().

14 {
15  FLA_Datatype datatype;
16  int m_A, n_A;
17  int rs_A, cs_A;
18  uplo1_t blis_uplo;
19 
20  if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
21  FLA_Setr_check( uplo, alpha, A );
22 
23  if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS;
24 
25  datatype = FLA_Obj_datatype( A );
26 
27  m_A = FLA_Obj_length( A );
28  n_A = FLA_Obj_width( A );
29 
30  rs_A = FLA_Obj_row_stride( A );
31  cs_A = FLA_Obj_col_stride( A );
32 
33  FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo );
34 
35  switch ( datatype ){
36 
37  case FLA_FLOAT:
38  {
39  float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
40  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
41 
42  bl1_ssetmr( blis_uplo,
43  m_A,
44  n_A,
45  buff_alpha,
46  buff_A, rs_A, cs_A );
47 
48  break;
49  }
50 
51  case FLA_DOUBLE:
52  {
53  double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
54  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
55 
56  bl1_dsetmr( blis_uplo,
57  m_A,
58  n_A,
59  buff_alpha,
60  buff_A, rs_A, cs_A );
61 
62  break;
63  }
64 
65  case FLA_COMPLEX:
66  {
67  scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha );
68  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
69 
70  bl1_csetmr( blis_uplo,
71  m_A,
72  n_A,
73  buff_alpha,
74  buff_A, rs_A, cs_A );
75 
76  break;
77  }
78 
79  case FLA_DOUBLE_COMPLEX:
80  {
81  dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha );
82  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
83 
84  bl1_zsetmr( blis_uplo,
85  m_A,
86  n_A,
87  buff_alpha,
88  buff_A, rs_A, cs_A );
89 
90  break;
91  }
92 
93  }
94 
95  return FLA_SUCCESS;
96 }
void bl1_dsetmr(uplo1_t uplo, int m, int n, double *sigma, double *a, int a_rs, int a_cs)
Definition: bl1_setmr.c:66
uplo1_t
Definition: blis_type_defs.h:60
void bl1_ssetmr(uplo1_t uplo, int m, int n, float *sigma, float *a, int a_rs, int a_cs)
Definition: bl1_setmr.c:13
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
void bl1_zsetmr(uplo1_t uplo, int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_setmr.c:172
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
FLA_Error FLA_Setr_check(FLA_Uplo uplo, FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Setr_check.c:13
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition: FLA_Query.c:400
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void bl1_csetmr(uplo1_t uplo, int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
Definition: bl1_setmr.c:119
void FLA_Param_map_flame_to_blis_uplo(FLA_Uplo uplo, uplo1_t *blis_uplo)
Definition: FLA_Param.c:285
Definition: blis_type_defs.h:132
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
Definition: blis_type_defs.h:137

◆ FLA_Setr_check()

FLA_Error FLA_Setr_check ( FLA_Uplo  uplo,
FLA_Obj  alpha,
FLA_Obj  A 
)

References FLA_Check_consistent_object_datatype(), FLA_Check_floating_object(), FLA_Check_nonconstant_object(), and FLA_Check_valid_uplo().

Referenced by FLA_Setr().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_uplo( uplo );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( A );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_consistent_object_datatype( alpha, A );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_valid_uplo(FLA_Uplo uplo)
Definition: FLA_Check.c:76
FLA_Error FLA_Check_consistent_object_datatype(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:339

◆ FLA_Shift_diag()

FLA_Error FLA_Shift_diag ( FLA_Conj  conj,
FLA_Obj  sigma,
FLA_Obj  A 
)

References bl1_cshiftdiag(), bl1_csshiftdiag(), bl1_dshiftdiag(), bl1_sshiftdiag(), bl1_zdshiftdiag(), bl1_zshiftdiag(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_conj(), and FLA_Shift_diag_check().

Referenced by FLA_Lyap_h_unb_var1(), FLA_Lyap_h_unb_var2(), FLA_Lyap_h_unb_var3(), FLA_Lyap_h_unb_var4(), FLA_Lyap_n_unb_var1(), FLA_Lyap_n_unb_var2(), FLA_Lyap_n_unb_var3(), FLA_Lyap_n_unb_var4(), and FLASH_Shift_diag().

14 {
15  FLA_Datatype datatype_A;
16  FLA_Datatype datatype_sigma;
17  dim_t m_A, n_A;
18  dim_t rs_A, cs_A;
19  conj1_t blis_conj;
20 
21  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
22  FLA_Shift_diag_check( conj, sigma, A );
23 
24  datatype_A = FLA_Obj_datatype( A );
25  datatype_sigma = FLA_Obj_datatype( sigma );
26  m_A = FLA_Obj_length( A );
27  n_A = FLA_Obj_width( A );
28  rs_A = FLA_Obj_row_stride( A );
29  cs_A = FLA_Obj_col_stride( A );
30 
31  FLA_Param_map_flame_to_blis_conj( conj, &blis_conj );
32 
33  switch( datatype_A ){
34 
35  case FLA_FLOAT:
36  {
37  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
38  float *buff_sigma = ( float * ) FLA_FLOAT_PTR( sigma );
39 
40  bl1_sshiftdiag( blis_conj,
41  0,
42  m_A,
43  n_A,
44  buff_sigma,
45  buff_A, rs_A, cs_A );
46 
47  break;
48  }
49  case FLA_DOUBLE:
50  {
51  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
52  double *buff_sigma = ( double * ) FLA_DOUBLE_PTR( sigma );
53 
54  bl1_dshiftdiag( blis_conj,
55  0,
56  m_A,
57  n_A,
58  buff_sigma,
59  buff_A, rs_A, cs_A );
60 
61  break;
62  }
63 
64  case FLA_COMPLEX:
65  {
66  if ( datatype_sigma == FLA_COMPLEX )
67  {
68  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
69  scomplex *buff_sigma = ( scomplex * ) FLA_COMPLEX_PTR( sigma );
70 
71  bl1_cshiftdiag( blis_conj,
72  0,
73  m_A,
74  n_A,
75  buff_sigma,
76  buff_A, rs_A, cs_A );
77  }
78  else
79  {
80  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
81  float *buff_sigma = ( float * ) FLA_FLOAT_PTR( sigma );
82 
83  bl1_csshiftdiag( blis_conj,
84  0,
85  m_A,
86  n_A,
87  buff_sigma,
88  buff_A, rs_A, cs_A );
89  }
90 
91  break;
92  }
93 
94  case FLA_DOUBLE_COMPLEX:
95  {
96  if ( datatype_sigma == FLA_DOUBLE_COMPLEX )
97  {
98  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
99  dcomplex *buff_sigma = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( sigma );
100 
101  bl1_zshiftdiag( blis_conj,
102  0,
103  m_A,
104  n_A,
105  buff_sigma,
106  buff_A, rs_A, cs_A );
107  }
108  else
109  {
110  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
111  double *buff_sigma = ( double * ) FLA_DOUBLE_PTR( sigma );
112 
113  bl1_zdshiftdiag( blis_conj,
114  0,
115  m_A,
116  n_A,
117  buff_sigma,
118  buff_A, rs_A, cs_A );
119  }
120 
121  break;
122  }
123 
124  }
125 
126  return FLA_SUCCESS;
127 }
unsigned long dim_t
Definition: FLA_type_defs.h:71
conj1_t
Definition: blis_type_defs.h:79
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
void bl1_sshiftdiag(conj1_t conj, int offset, int m, int n, float *sigma, float *a, int a_rs, int a_cs)
Definition: bl1_shiftdiag.c:13
FLA_Error FLA_Shift_diag_check(FLA_Conj conj, FLA_Obj sigma, FLA_Obj A)
Definition: FLA_Shift_diag_check.c:13
void bl1_zshiftdiag(conj1_t conj, int offset, int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_shiftdiag.c:122
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void bl1_zdshiftdiag(conj1_t conj, int offset, int m, int n, double *sigma, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_shiftdiag.c:76
Definition: blis_type_defs.h:132
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
void FLA_Param_map_flame_to_blis_conj(FLA_Conj conj, conj1_t *blis_conj)
Definition: FLA_Param.c:269
int FLA_Datatype
Definition: FLA_type_defs.h:49
void bl1_csshiftdiag(conj1_t conj, int offset, int m, int n, float *sigma, scomplex *a, int a_rs, int a_cs)
Definition: bl1_shiftdiag.c:55
void bl1_dshiftdiag(conj1_t conj, int offset, int m, int n, double *sigma, double *a, int a_rs, int a_cs)
Definition: bl1_shiftdiag.c:34
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
void bl1_cshiftdiag(conj1_t conj, int offset, int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
Definition: bl1_shiftdiag.c:97
Definition: blis_type_defs.h:137

◆ FLA_Shift_diag_check()

FLA_Error FLA_Shift_diag_check ( FLA_Conj  conj,
FLA_Obj  sigma,
FLA_Obj  A 
)

References FLA_Check_consistent_object_datatype(), FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), FLA_Check_valid_conj(), and FLA_Obj_is_real().

Referenced by FLA_Shift_diag().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_conj( conj );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( A );
24  FLA_Check_error_code( e_val );
25 
26  if ( FLA_Obj_is_real( A ) )
27  {
28  e_val = FLA_Check_consistent_object_datatype( A, sigma );
29  FLA_Check_error_code( e_val );
30  }
31  else
32  {
33  e_val = FLA_Check_identical_object_precision( A, sigma );
34  FLA_Check_error_code( e_val );
35  }
36 
37  e_val = FLA_Check_if_scalar( sigma );
38  FLA_Check_error_code( e_val );
39 
40  return FLA_SUCCESS;
41 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_identical_object_precision(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:298
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_valid_conj(FLA_Conj conj)
Definition: FLA_Check.c:112
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373
FLA_Bool FLA_Obj_is_real(FLA_Obj A)
Definition: FLA_Query.c:307
FLA_Error FLA_Check_consistent_object_datatype(FLA_Obj A, FLA_Obj B)
Definition: FLA_Check.c:339

◆ FLA_Shift_pivots_to_check()

FLA_Error FLA_Shift_pivots_to_check ( FLA_Pivot_type  ptype,
FLA_Obj  p 
)
14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_pivot_type( ptype );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_int_object( p );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( p );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_col_vector( p );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
FLA_Error FLA_Check_int_object(FLA_Obj A)
Definition: FLA_Check.c:245
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_valid_pivot_type(FLA_Pivot_type ptype)
Definition: FLA_Check.c:552
FLA_Error FLA_Check_col_vector(FLA_Obj x)
Definition: FLA_Check.c:1233

◆ FLA_Sort()

FLA_Error FLA_Sort ( FLA_Direct  direct,
FLA_Obj  x 
)

References FLA_Check_error_level(), FLA_Copy(), FLA_Obj_create_copy_of(), FLA_Obj_datatype(), FLA_Obj_free(), FLA_Obj_vector_dim(), FLA_Obj_vector_inc(), FLA_Sort_b_opd(), FLA_Sort_b_ops(), FLA_Sort_check(), FLA_Sort_f_opd(), and FLA_Sort_f_ops().

Referenced by FLA_Fill_with_cluster_dist(), and FLA_Sort_bsvd_ext().

19 {
20  FLA_Datatype datatype;
21  FLA_Obj x_use;
22  dim_t m_x;
23  dim_t inc_x;
24 
25  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
26  FLA_Sort_check( direct, x );
27 
28  datatype = FLA_Obj_datatype( x );
29 
30  m_x = FLA_Obj_vector_dim( x );
31  inc_x = FLA_Obj_vector_inc( x );
32 
33  // If the vector does not have unit stride, copy it to a temporary vector
34  // that does have unit stride.
35  if ( inc_x != 1 )
36  {
37  FLA_Obj_create_copy_of( FLA_NO_TRANSPOSE, x, &x_use );
38  inc_x = FLA_Obj_vector_inc( x_use );
39  }
40  else
41  {
42  x_use = x;
43  }
44 
45  switch ( datatype )
46  {
47  case FLA_FLOAT:
48  {
49  float* x_p = ( float* ) FLA_FLOAT_PTR( x_use );
50 
51  if ( direct == FLA_FORWARD )
52  FLA_Sort_f_ops( m_x,
53  x_p, inc_x );
54  else // if ( direct == FLA_BACKWARD )
55  FLA_Sort_b_ops( m_x,
56  x_p, inc_x );
57 
58  break;
59  }
60 
61  case FLA_DOUBLE:
62  {
63  double* x_p = ( double* ) FLA_DOUBLE_PTR( x_use );
64 
65  if ( direct == FLA_FORWARD )
66  FLA_Sort_f_opd( m_x,
67  x_p, inc_x );
68  else // if ( direct == FLA_BACKWARD )
69  FLA_Sort_b_opd( m_x,
70  x_p, inc_x );
71 
72  break;
73  }
74 
75  }
76 
77  if ( inc_x != 1 )
78  {
79  FLA_Copy( x_use, x );
80  FLA_Obj_free( &x_use );
81  }
82 
83  return FLA_SUCCESS;
84 }
FLA_Error FLA_Sort_f_opd(int m_x, double *x, int inc_x)
Definition: FLA_Sort.c:110
unsigned long dim_t
Definition: FLA_type_defs.h:71
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition: FLA_Obj.c:588
FLA_Error FLA_Sort_b_ops(int m_x, float *x, int inc_x)
Definition: FLA_Sort.c:99
FLA_Error FLA_Copy(FLA_Obj A, FLA_Obj B)
Definition: FLA_Copy.c:15
FLA_Error FLA_Obj_create_copy_of(FLA_Trans trans, FLA_Obj old, FLA_Obj *obj)
Definition: FLA_Obj.c:345
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
FLA_Error FLA_Sort_b_opd(int m_x, double *x, int inc_x)
Definition: FLA_Sort.c:121
FLA_Error FLA_Sort_f_ops(int m_x, float *x, int inc_x)
Definition: FLA_Sort.c:88
Definition: FLA_type_defs.h:158
FLA_Error FLA_Sort_check(FLA_Direct direct, FLA_Obj x)
Definition: FLA_Sort_check.c:13
dim_t FLA_Obj_vector_dim(FLA_Obj obj)
Definition: FLA_Query.c:137
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_vector_inc(FLA_Obj obj)
Definition: FLA_Query.c:145

◆ FLA_Sort_b_opd()

FLA_Error FLA_Sort_b_opd ( int  m_x,
double *  x,
int  inc_x 
)

References fla_dcomp_b().

Referenced by FLA_Sort().

123 {
124  qsort( x,
125  m_x,
126  sizeof( double ),
127  fla_dcomp_b );
128 
129  return FLA_SUCCESS;
130 }
int fla_dcomp_b(const void *a, const void *b)
Definition: FLA_Sort.c:175

◆ FLA_Sort_b_ops()

FLA_Error FLA_Sort_b_ops ( int  m_x,
float *  x,
int  inc_x 
)

References fla_scomp_b().

Referenced by FLA_Sort().

101 {
102  qsort( x,
103  m_x,
104  sizeof( float ),
105  fla_scomp_b );
106 
107  return FLA_SUCCESS;
108 }
int fla_scomp_b(const void *a, const void *b)
Definition: FLA_Sort.c:149

◆ FLA_Sort_check()

FLA_Error FLA_Sort_check ( FLA_Direct  direct,
FLA_Obj  x 
)

References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), and FLA_Check_valid_direct().

Referenced by FLA_Sort().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_direct( direct );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( x );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( x );
24  FLA_Check_error_code( e_val );
25 
26  return FLA_SUCCESS;
27 }
FLA_Error FLA_Check_valid_direct(FLA_Conj direct)
Definition: FLA_Check.c:123
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232

◆ FLA_Sort_f_opd()

FLA_Error FLA_Sort_f_opd ( int  m_x,
double *  x,
int  inc_x 
)

References fla_dcomp_f().

Referenced by FLA_Sort().

112 {
113  qsort( x,
114  m_x,
115  sizeof( double ),
116  fla_dcomp_f );
117 
118  return FLA_SUCCESS;
119 }
int fla_dcomp_f(const void *a, const void *b)
Definition: FLA_Sort.c:162

◆ FLA_Sort_f_ops()

FLA_Error FLA_Sort_f_ops ( int  m_x,
float *  x,
int  inc_x 
)

References fla_scomp_f().

Referenced by FLA_Sort().

90 {
91  qsort( x,
92  m_x,
93  sizeof( float ),
94  fla_scomp_f );
95 
96  return FLA_SUCCESS;
97 }
int fla_scomp_f(const void *a, const void *b)
Definition: FLA_Sort.c:136

◆ FLA_Sqrt()

FLA_Error FLA_Sqrt ( FLA_Obj  alpha)

References FLA_Check_error_level(), FLA_Obj_datatype(), FLA_Sqrt_check(), scomplex::real, and dcomplex::real.

Referenced by FLA_Chol_l_unb_var1(), FLA_Chol_l_unb_var2(), FLA_Chol_l_unb_var3(), FLA_Chol_u_unb_var1(), FLA_Chol_u_unb_var2(), FLA_Chol_u_unb_var3(), FLA_Hevd_compute_scaling(), and FLA_Svd_compute_scaling().

14 {
15  FLA_Datatype datatype;
16  int r_val = FLA_SUCCESS;
17 
18  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
19  FLA_Sqrt_check( alpha );
20 
21  datatype = FLA_Obj_datatype( alpha );
22 
23  switch ( datatype ){
24 
25  case FLA_FLOAT:
26  {
27  float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
28 
29  if ( *buff_alpha <= 0.0F || isnan(*buff_alpha) )
30  r_val = FLA_FAILURE;
31  else
32  *buff_alpha = ( float ) sqrt( *buff_alpha );
33 
34  break;
35  }
36 
37  case FLA_DOUBLE:
38  {
39  double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
40 
41  if ( *buff_alpha <= 0.0 || isnan(*buff_alpha) )
42  r_val = FLA_FAILURE;
43  else
44  *buff_alpha = ( double ) sqrt( *buff_alpha );
45 
46  break;
47  }
48 
49  case FLA_COMPLEX:
50  {
51  scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha );
52 
53  if ( buff_alpha->real <= 0.0F || isnan(buff_alpha->real) )
54  r_val = FLA_FAILURE;
55  else
56  buff_alpha->real = ( float ) sqrt( buff_alpha->real );
57 
58  break;
59  }
60 
61  case FLA_DOUBLE_COMPLEX:
62  {
63  dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha );
64 
65  if ( buff_alpha->real <= 0.0 || isnan(buff_alpha->real) )
66  r_val = FLA_FAILURE;
67  else
68  buff_alpha->real = ( double ) sqrt( buff_alpha->real );
69 
70  break;
71  }
72 
73  }
74 
75  return r_val;
76 }
float real
Definition: blis_type_defs.h:134
double real
Definition: blis_type_defs.h:139
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
Definition: blis_type_defs.h:132
FLA_Error FLA_Sqrt_check(FLA_Obj alpha)
Definition: FLA_Sqrt_check.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
Definition: blis_type_defs.h:137

◆ FLA_Sqrt_check()

FLA_Error FLA_Sqrt_check ( FLA_Obj  alpha)

References FLA_Check_floating_object(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().

Referenced by FLA_Sqrt().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( alpha );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( alpha );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_if_scalar( alpha );
24  FLA_Check_error_code( e_val );
25 
26  return FLA_SUCCESS;
27 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_if_scalar(FLA_Obj A)
Definition: FLA_Check.c:373

◆ FLA_Swap_t_blk_var1()

FLA_Error FLA_Swap_t_blk_var1 ( FLA_Obj  A,
FLA_Obj  B,
fla_swap_t cntl 
)

References FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x1_to_2x1(), FLA_Determine_blocksize(), FLA_Obj_width(), FLA_Part_1x2(), FLA_Part_2x1(), FLA_Repart_1x2_to_1x3(), FLA_Repart_2x1_to_3x1(), and FLA_Swapt_external().

Referenced by FLA_Transpose_blk_var1().

14 {
15  FLA_Obj AL, AR, A0, A1, A2;
16 
17  FLA_Obj BT, B0,
18  BB, B1,
19  B2;
20 
21  dim_t b;
22 
23  FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT );
24 
25  FLA_Part_2x1( B, &BT,
26  &BB, 0, FLA_TOP );
27 
28  while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){
29 
30  b = FLA_Determine_blocksize( AR, FLA_RIGHT, FLA_Cntl_blocksize( cntl ) );
31 
32  FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &A1, &A2,
33  b, FLA_RIGHT );
34 
35  FLA_Repart_2x1_to_3x1( BT, &B0,
36  /* ** */ /* ** */
37  &B1,
38  BB, &B2, b, FLA_BOTTOM );
39 
40  /*------------------------------------------------------------*/
41 
42  FLA_Swapt_external( FLA_TRANSPOSE, A1, B1 );
43 
44  /*------------------------------------------------------------*/
45 
46  FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, A1, /**/ A2,
47  FLA_LEFT );
48 
49  FLA_Cont_with_3x1_to_2x1( &BT, B0,
50  B1,
51  /* ** */ /* ** */
52  &BB, B2, FLA_TOP );
53 
54  }
55 
56  return FLA_SUCCESS;
57 }
FLA_Error FLA_Repart_2x1_to_3x1(FLA_Obj AT, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj AB, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:226
FLA_Error FLA_Repart_1x2_to_1x3(FLA_Obj AL, FLA_Obj AR, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj *A2, dim_t nb, FLA_Side side)
Definition: FLA_View.c:267
unsigned long dim_t
Definition: FLA_type_defs.h:71
dim_t FLA_Determine_blocksize(FLA_Obj A_unproc, FLA_Quadrant to_dir, fla_blocksize_t *cntl_blocksizes)
Definition: FLA_Blocksize.c:234
FLA_Error FLA_Cont_with_3x1_to_2x1(FLA_Obj *AT, FLA_Obj A0, FLA_Obj A1, FLA_Obj *AB, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:428
Definition: FLA_type_defs.h:158
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
FLA_Error FLA_Cont_with_1x3_to_1x2(FLA_Obj *AL, FLA_Obj *AR, FLA_Obj A0, FLA_Obj A1, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:475
FLA_Error FLA_Swapt_external(FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition: FLA_Swapt_external.c:13
FLA_Error FLA_Part_2x1(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:76
FLA_Error FLA_Part_1x2(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t nb, FLA_Side side)
Definition: FLA_View.c:110

◆ FLA_Swap_t_blk_var2()

FLA_Error FLA_Swap_t_blk_var2 ( FLA_Obj  A,
FLA_Obj  B,
fla_swap_t cntl 
)

References FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x1_to_2x1(), FLA_Determine_blocksize(), FLA_Obj_length(), FLA_Part_1x2(), FLA_Part_2x1(), FLA_Repart_1x2_to_1x3(), FLA_Repart_2x1_to_3x1(), and FLA_Swapt_external().

Referenced by FLA_Transpose_blk_var2().

14 {
15  FLA_Obj AT, A0,
16  AB, A1,
17  A2;
18 
19  FLA_Obj BL, BR, B0, B1, B2;
20 
21  dim_t b;
22 
23  FLA_Part_2x1( A, &AT,
24  &AB, 0, FLA_TOP );
25 
26  FLA_Part_1x2( B, &BL, &BR, 0, FLA_LEFT );
27 
28  while ( FLA_Obj_length( AT ) < FLA_Obj_length( A ) ){
29 
30  b = FLA_Determine_blocksize( AB, FLA_BOTTOM, FLA_Cntl_blocksize( cntl ) );
31 
32  FLA_Repart_2x1_to_3x1( AT, &A0,
33  /* ** */ /* ** */
34  &A1,
35  AB, &A2, b, FLA_BOTTOM );
36 
37  FLA_Repart_1x2_to_1x3( BL, /**/ BR, &B0, /**/ &B1, &B2,
38  b, FLA_RIGHT );
39 
40  /*------------------------------------------------------------*/
41 
42  FLA_Swapt_external( FLA_TRANSPOSE, A1, B1 );
43 
44  /*------------------------------------------------------------*/
45 
46  FLA_Cont_with_3x1_to_2x1( &AT, A0,
47  A1,
48  /* ** */ /* ** */
49  &AB, A2, FLA_TOP );
50 
51  FLA_Cont_with_1x3_to_1x2( &BL, /**/ &BR, B0, B1, /**/ B2,
52  FLA_LEFT );
53 
54  }
55 
56  return FLA_SUCCESS;
57 }
FLA_Error FLA_Repart_2x1_to_3x1(FLA_Obj AT, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj AB, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:226
FLA_Error FLA_Repart_1x2_to_1x3(FLA_Obj AL, FLA_Obj AR, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj *A2, dim_t nb, FLA_Side side)
Definition: FLA_View.c:267
unsigned long dim_t
Definition: FLA_type_defs.h:71
dim_t FLA_Determine_blocksize(FLA_Obj A_unproc, FLA_Quadrant to_dir, fla_blocksize_t *cntl_blocksizes)
Definition: FLA_Blocksize.c:234
FLA_Error FLA_Cont_with_3x1_to_2x1(FLA_Obj *AT, FLA_Obj A0, FLA_Obj A1, FLA_Obj *AB, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:428
Definition: FLA_type_defs.h:158
FLA_Error FLA_Cont_with_1x3_to_1x2(FLA_Obj *AL, FLA_Obj *AR, FLA_Obj A0, FLA_Obj A1, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:475
FLA_Error FLA_Swapt_external(FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition: FLA_Swapt_external.c:13
FLA_Error FLA_Part_2x1(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:76
FLA_Error FLA_Part_1x2(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t nb, FLA_Side side)
Definition: FLA_View.c:110
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116

◆ FLA_Symmetrize()

FLA_Error FLA_Symmetrize ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References bl1_csymmize(), bl1_dsymmize(), bl1_ssymmize(), bl1_zsymmize(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_conj(), FLA_Param_map_flame_to_blis_uplo(), and FLA_Symmetrize_check().

Referenced by FLA_Random_symm_matrix().

14 {
15  FLA_Datatype datatype;
16  dim_t n_A;
17  dim_t rs_A, cs_A;
18  conj1_t blis_conj;
19  uplo1_t blis_uplo;
20 
21  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
22  FLA_Symmetrize_check( uplo, A );
23 
24  datatype = FLA_Obj_datatype( A );
25 
26  n_A = FLA_Obj_width( A );
27  rs_A = FLA_Obj_row_stride( A );
28  cs_A = FLA_Obj_col_stride( A );
29 
30  FLA_Param_map_flame_to_blis_conj( FLA_NO_CONJUGATE, &blis_conj );
31  FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo );
32 
33 
34  switch ( datatype ){
35 
36  case FLA_FLOAT:
37  {
38  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
39 
40  bl1_ssymmize( blis_conj,
41  blis_uplo,
42  n_A,
43  buff_A, rs_A, cs_A );
44 
45  break;
46  }
47 
48  case FLA_DOUBLE:
49  {
50  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
51 
52  bl1_dsymmize( blis_conj,
53  blis_uplo,
54  n_A,
55  buff_A, rs_A, cs_A );
56 
57  break;
58  }
59 
60  case FLA_COMPLEX:
61  {
62  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
63 
64  bl1_csymmize( blis_conj,
65  blis_uplo,
66  n_A,
67  buff_A, rs_A, cs_A );
68 
69  break;
70  }
71 
72  case FLA_DOUBLE_COMPLEX:
73  {
74  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
75 
76  bl1_zsymmize( blis_conj,
77  blis_uplo,
78  n_A,
79  buff_A, rs_A, cs_A );
80 
81  break;
82  }
83 
84  }
85 
86  return FLA_SUCCESS;
87 }
unsigned long dim_t
Definition: FLA_type_defs.h:71
uplo1_t
Definition: blis_type_defs.h:60
void bl1_ssymmize(conj1_t conj, uplo1_t uplo, int m, float *a, int a_rs, int a_cs)
Definition: bl1_symmize.c:13
void bl1_zsymmize(conj1_t conj, uplo1_t uplo, int m, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_symmize.c:353
conj1_t
Definition: blis_type_defs.h:79
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
void bl1_dsymmize(conj1_t conj, uplo1_t uplo, int m, double *a, int a_rs, int a_cs)
Definition: bl1_symmize.c:124
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void FLA_Param_map_flame_to_blis_uplo(FLA_Uplo uplo, uplo1_t *blis_uplo)
Definition: FLA_Param.c:285
Definition: blis_type_defs.h:132
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
void FLA_Param_map_flame_to_blis_conj(FLA_Conj conj, conj1_t *blis_conj)
Definition: FLA_Param.c:269
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
void bl1_csymmize(conj1_t conj, uplo1_t uplo, int m, scomplex *a, int a_rs, int a_cs)
Definition: bl1_symmize.c:235
Definition: blis_type_defs.h:137
FLA_Error FLA_Symmetrize_check(FLA_Uplo uplo, FLA_Obj A)
Definition: FLA_Symmetrize_check.c:13

◆ FLA_Symmetrize_check()

FLA_Error FLA_Symmetrize_check ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_square(), and FLA_Check_valid_uplo().

Referenced by FLA_Symmetrize().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_uplo( uplo );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_floating_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_nonconstant_object( A );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_square( A );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_square(FLA_Obj A)
Definition: FLA_Check.c:363
FLA_Error FLA_Check_valid_uplo(FLA_Uplo uplo)
Definition: FLA_Check.c:76

◆ FLA_Transpose()

FLA_Error FLA_Transpose ( FLA_Obj  A)

References FLA_Check_error_level(), FLA_Transpose_blk_var2(), and FLA_Transpose_check().

16 {
17  FLA_Error r_val;
18 
19  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
21 
23 
24  return r_val;
25 }
FLA_Error FLA_Transpose_check(FLA_Obj A)
Definition: FLA_Transpose_check.c:13
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Transpose_blk_var2(FLA_Obj A, fla_tpose_t *cntl)
Definition: FLA_Transpose_blk_var2.c:13
fla_tpose_t * fla_tpose_cntl
Definition: FLA_Transpose_cntl_init.c:16
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18

◆ FLA_Transpose_blk_var1()

FLA_Error FLA_Transpose_blk_var1 ( FLA_Obj  A,
fla_tpose_t cntl 
)

References FLA_Cont_with_3x3_to_2x2(), FLA_Determine_blocksize(), FLA_Obj_length(), FLA_Part_2x2(), FLA_Repart_2x2_to_3x3(), FLA_Swap_t_blk_var1(), and FLA_Transpose_unb_var1().

14 {
15  FLA_Obj ATL, ATR, A00, A01, A02,
16  ABL, ABR, A10, A11, A12,
17  A20, A21, A22;
18 
19  dim_t b;
20 
21  FLA_Part_2x2( A, &ATL, &ATR,
22  &ABL, &ABR, 0, 0, FLA_TL );
23 
24  while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) ){
25 
26  b = FLA_Determine_blocksize( ABR, FLA_BR, FLA_Cntl_blocksize( cntl ) );
27 
28  FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02,
29  /* ************* */ /* ******************** */
30  &A10, /**/ &A11, &A12,
31  ABL, /**/ ABR, &A20, /**/ &A21, &A22,
32  b, b, FLA_BR );
33 
34  /*------------------------------------------------------------*/
35 
37 
38  FLA_Swap_t_blk_var1( A10, A01,
39  FLA_Cntl_sub_swap( cntl ) );
40 
41  /*------------------------------------------------------------*/
42 
43  FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
44  A10, A11, /**/ A12,
45  /* ************** */ /* ****************** */
46  &ABL, /**/ &ABR, A20, A21, /**/ A22,
47  FLA_TL );
48 
49  }
50 
51  return FLA_SUCCESS;
52 }
unsigned long dim_t
Definition: FLA_type_defs.h:71
dim_t FLA_Determine_blocksize(FLA_Obj A_unproc, FLA_Quadrant to_dir, fla_blocksize_t *cntl_blocksizes)
Definition: FLA_Blocksize.c:234
FLA_Error FLA_Repart_2x2_to_3x3(FLA_Obj ATL, FLA_Obj ATR, FLA_Obj *A00, FLA_Obj *A01, FLA_Obj *A02, FLA_Obj *A10, FLA_Obj *A11, FLA_Obj *A12, FLA_Obj ABL, FLA_Obj ABR, FLA_Obj *A20, FLA_Obj *A21, FLA_Obj *A22, dim_t mb, dim_t nb, FLA_Quadrant quadrant)
Definition: FLA_View.c:142
FLA_Error FLA_Part_2x2(FLA_Obj A, FLA_Obj *A11, FLA_Obj *A12, FLA_Obj *A21, FLA_Obj *A22, dim_t mb, dim_t nb, FLA_Quadrant quadrant)
Definition: FLA_View.c:17
Definition: FLA_type_defs.h:158
FLA_Error FLA_Cont_with_3x3_to_2x2(FLA_Obj *ATL, FLA_Obj *ATR, FLA_Obj A00, FLA_Obj A01, FLA_Obj A02, FLA_Obj A10, FLA_Obj A11, FLA_Obj A12, FLA_Obj *ABL, FLA_Obj *ABR, FLA_Obj A20, FLA_Obj A21, FLA_Obj A22, FLA_Quadrant quadrant)
Definition: FLA_View.c:304
FLA_Error FLA_Swap_t_blk_var1(FLA_Obj A, FLA_Obj B, fla_swap_t *cntl)
Definition: FLA_Swap_t_blk_var1.c:13
FLA_Error FLA_Transpose_unb_var1(FLA_Obj A)
Definition: FLA_Transpose_unb_var1.c:13
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116

◆ FLA_Transpose_blk_var2()

FLA_Error FLA_Transpose_blk_var2 ( FLA_Obj  A,
fla_tpose_t cntl 
)

References FLA_Cont_with_3x3_to_2x2(), FLA_Determine_blocksize(), FLA_Obj_length(), FLA_Part_2x2(), FLA_Repart_2x2_to_3x3(), FLA_Swap_t_blk_var2(), and FLA_Transpose_unb_var2().

Referenced by FLA_Transpose().

14 {
15  FLA_Obj ATL, ATR, A00, A01, A02,
16  ABL, ABR, A10, A11, A12,
17  A20, A21, A22;
18 
19  dim_t b;
20 
21  FLA_Part_2x2( A, &ATL, &ATR,
22  &ABL, &ABR, 0, 0, FLA_TL );
23 
24  while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) ){
25 
26  b = FLA_Determine_blocksize( ABR, FLA_BR, FLA_Cntl_blocksize( cntl ) );
27 
28  FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02,
29  /* ************* */ /* ******************** */
30  &A10, /**/ &A11, &A12,
31  ABL, /**/ ABR, &A20, /**/ &A21, &A22,
32  b, b, FLA_BR );
33 
34  /*------------------------------------------------------------*/
35 
37 
38  FLA_Swap_t_blk_var2( A21, A12,
39  FLA_Cntl_sub_swap( cntl ) );
40 
41  /*------------------------------------------------------------*/
42 
43  FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
44  A10, A11, /**/ A12,
45  /* ************** */ /* ****************** */
46  &ABL, /**/ &ABR, A20, A21, /**/ A22,
47  FLA_TL );
48 
49  }
50 
51  return FLA_SUCCESS;
52 }
unsigned long dim_t
Definition: FLA_type_defs.h:71
dim_t FLA_Determine_blocksize(FLA_Obj A_unproc, FLA_Quadrant to_dir, fla_blocksize_t *cntl_blocksizes)
Definition: FLA_Blocksize.c:234
FLA_Error FLA_Repart_2x2_to_3x3(FLA_Obj ATL, FLA_Obj ATR, FLA_Obj *A00, FLA_Obj *A01, FLA_Obj *A02, FLA_Obj *A10, FLA_Obj *A11, FLA_Obj *A12, FLA_Obj ABL, FLA_Obj ABR, FLA_Obj *A20, FLA_Obj *A21, FLA_Obj *A22, dim_t mb, dim_t nb, FLA_Quadrant quadrant)
Definition: FLA_View.c:142
FLA_Error FLA_Part_2x2(FLA_Obj A, FLA_Obj *A11, FLA_Obj *A12, FLA_Obj *A21, FLA_Obj *A22, dim_t mb, dim_t nb, FLA_Quadrant quadrant)
Definition: FLA_View.c:17
Definition: FLA_type_defs.h:158
FLA_Error FLA_Swap_t_blk_var2(FLA_Obj A, FLA_Obj B, fla_swap_t *cntl)
Definition: FLA_Swap_t_blk_var2.c:13
FLA_Error FLA_Cont_with_3x3_to_2x2(FLA_Obj *ATL, FLA_Obj *ATR, FLA_Obj A00, FLA_Obj A01, FLA_Obj A02, FLA_Obj A10, FLA_Obj A11, FLA_Obj A12, FLA_Obj *ABL, FLA_Obj *ABR, FLA_Obj A20, FLA_Obj A21, FLA_Obj A22, FLA_Quadrant quadrant)
Definition: FLA_View.c:304
FLA_Error FLA_Transpose_unb_var2(FLA_Obj A)
Definition: FLA_Transpose_unb_var2.c:13
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116

◆ FLA_Transpose_check()

FLA_Error FLA_Transpose_check ( FLA_Obj  A)

References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), and FLA_Check_square().

Referenced by FLA_Transpose().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_floating_object( A );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_nonconstant_object( A );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_square( A );
24  FLA_Check_error_code( e_val );
25 
26  return FLA_SUCCESS;
27 }
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_square(FLA_Obj A)
Definition: FLA_Check.c:363

◆ FLA_Transpose_unb_var1()

FLA_Error FLA_Transpose_unb_var1 ( FLA_Obj  A)

References FLA_Cont_with_3x3_to_2x2(), FLA_Obj_length(), FLA_Part_2x2(), FLA_Repart_2x2_to_3x3(), and FLA_Swapt_external().

Referenced by FLA_Transpose_blk_var1().

14 {
15  FLA_Obj ATL, ATR, A00, a01, A02,
16  ABL, ABR, a10t, alpha11, a12t,
17  A20, a21, A22;
18 
19  FLA_Part_2x2( A, &ATL, &ATR,
20  &ABL, &ABR, 0, 0, FLA_TL );
21 
22  while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) ){
23 
24  FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &a01, &A02,
25  /* ************* */ /* ************************** */
26  &a10t, /**/ &alpha11, &a12t,
27  ABL, /**/ ABR, &A20, /**/ &a21, &A22,
28  1, 1, FLA_BR );
29 
30  /*------------------------------------------------------------*/
31 
32  FLA_Swapt_external( FLA_TRANSPOSE, a10t, a01 );
33 
34  /*------------------------------------------------------------*/
35 
36  FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, a01, /**/ A02,
37  a10t, alpha11, /**/ a12t,
38  /* ************** */ /* ************************ */
39  &ABL, /**/ &ABR, A20, a21, /**/ A22,
40  FLA_TL );
41 
42  }
43 
44  return FLA_SUCCESS;
45 }
FLA_Error FLA_Repart_2x2_to_3x3(FLA_Obj ATL, FLA_Obj ATR, FLA_Obj *A00, FLA_Obj *A01, FLA_Obj *A02, FLA_Obj *A10, FLA_Obj *A11, FLA_Obj *A12, FLA_Obj ABL, FLA_Obj ABR, FLA_Obj *A20, FLA_Obj *A21, FLA_Obj *A22, dim_t mb, dim_t nb, FLA_Quadrant quadrant)
Definition: FLA_View.c:142
FLA_Error FLA_Part_2x2(FLA_Obj A, FLA_Obj *A11, FLA_Obj *A12, FLA_Obj *A21, FLA_Obj *A22, dim_t mb, dim_t nb, FLA_Quadrant quadrant)
Definition: FLA_View.c:17
Definition: FLA_type_defs.h:158
FLA_Error FLA_Swapt_external(FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition: FLA_Swapt_external.c:13
FLA_Error FLA_Cont_with_3x3_to_2x2(FLA_Obj *ATL, FLA_Obj *ATR, FLA_Obj A00, FLA_Obj A01, FLA_Obj A02, FLA_Obj A10, FLA_Obj A11, FLA_Obj A12, FLA_Obj *ABL, FLA_Obj *ABR, FLA_Obj A20, FLA_Obj A21, FLA_Obj A22, FLA_Quadrant quadrant)
Definition: FLA_View.c:304
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116

◆ FLA_Transpose_unb_var2()

FLA_Error FLA_Transpose_unb_var2 ( FLA_Obj  A)

References FLA_Cont_with_3x3_to_2x2(), FLA_Obj_length(), FLA_Part_2x2(), FLA_Repart_2x2_to_3x3(), and FLA_Swapt_external().

Referenced by FLA_Transpose_blk_var2().

14 {
15  FLA_Obj ATL, ATR, A00, a01, A02,
16  ABL, ABR, a10t, alpha11, a12t,
17  A20, a21, A22;
18 
19  FLA_Part_2x2( A, &ATL, &ATR,
20  &ABL, &ABR, 0, 0, FLA_TL );
21 
22  while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) ){
23 
24  FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &a01, &A02,
25  /* ************* */ /* ************************** */
26  &a10t, /**/ &alpha11, &a12t,
27  ABL, /**/ ABR, &A20, /**/ &a21, &A22,
28  1, 1, FLA_BR );
29 
30  /*------------------------------------------------------------*/
31 
32  FLA_Swapt_external( FLA_TRANSPOSE, a21, a12t );
33 
34  /*------------------------------------------------------------*/
35 
36  FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, a01, /**/ A02,
37  a10t, alpha11, /**/ a12t,
38  /* ************** */ /* ************************ */
39  &ABL, /**/ &ABR, A20, a21, /**/ A22,
40  FLA_TL );
41 
42  }
43 
44  return FLA_SUCCESS;
45 }
FLA_Error FLA_Repart_2x2_to_3x3(FLA_Obj ATL, FLA_Obj ATR, FLA_Obj *A00, FLA_Obj *A01, FLA_Obj *A02, FLA_Obj *A10, FLA_Obj *A11, FLA_Obj *A12, FLA_Obj ABL, FLA_Obj ABR, FLA_Obj *A20, FLA_Obj *A21, FLA_Obj *A22, dim_t mb, dim_t nb, FLA_Quadrant quadrant)
Definition: FLA_View.c:142
FLA_Error FLA_Part_2x2(FLA_Obj A, FLA_Obj *A11, FLA_Obj *A12, FLA_Obj *A21, FLA_Obj *A22, dim_t mb, dim_t nb, FLA_Quadrant quadrant)
Definition: FLA_View.c:17
Definition: FLA_type_defs.h:158
FLA_Error FLA_Swapt_external(FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition: FLA_Swapt_external.c:13
FLA_Error FLA_Cont_with_3x3_to_2x2(FLA_Obj *ATL, FLA_Obj *ATR, FLA_Obj A00, FLA_Obj A01, FLA_Obj A02, FLA_Obj A10, FLA_Obj A11, FLA_Obj A12, FLA_Obj *ABL, FLA_Obj *ABR, FLA_Obj A20, FLA_Obj A21, FLA_Obj A22, FLA_Quadrant quadrant)
Definition: FLA_View.c:304
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116

◆ FLA_Triangularize()

FLA_Error FLA_Triangularize ( FLA_Uplo  uplo,
FLA_Diag  diag,
FLA_Obj  A 
)

References bl1_csetdiag(), bl1_csetmr(), bl1_dsetdiag(), bl1_dsetmr(), bl1_ssetdiag(), bl1_ssetmr(), bl1_zsetdiag(), bl1_zsetmr(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_ONE, FLA_Param_map_flame_to_blis_uplo(), FLA_Triangularize_check(), and FLA_ZERO.

Referenced by FLA_Bidiag_UT_u_blf_var4(), FLA_Bidiag_UT_u_blk_var4(), FLA_Bidiag_UT_u_blk_var5(), FLA_Hess_UT_blf_var2(), FLA_Hess_UT_blf_var3(), FLA_Hess_UT_blf_var4(), FLA_Hess_UT_blk_var1(), FLA_Hess_UT_blk_var2(), FLA_Hess_UT_blk_var3(), FLA_Hess_UT_blk_var4(), FLA_SA_LU_unb(), FLA_Tridiag_UT_l_blf_var3(), FLA_Tridiag_UT_l_blk_var3(), and FLASH_Triangularize().

14 {
15  FLA_Datatype datatype;
16  int m_A, n_A;
17  int rs_A, cs_A;
18  uplo1_t blis_uplo;
19 
20  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
21  FLA_Triangularize_check( uplo, diag, A );
22 
23  datatype = FLA_Obj_datatype( A );
24 
25  m_A = FLA_Obj_length( A );
26  n_A = FLA_Obj_width( A );
27  rs_A = FLA_Obj_row_stride( A );
28  cs_A = FLA_Obj_col_stride( A );
29 
30  // We have to toggle the uplo parameter because we will use it to specify
31  // which triangle to zero out.
32  if ( uplo == FLA_LOWER_TRIANGULAR ) uplo = FLA_UPPER_TRIANGULAR;
33  else uplo = FLA_LOWER_TRIANGULAR;
34 
35  FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo );
36 
37  switch ( datatype ){
38 
39  case FLA_FLOAT:
40  {
41  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
42  float *buff_0 = ( float * ) FLA_FLOAT_PTR( FLA_ZERO );
43  float *buff_1 = ( float * ) FLA_FLOAT_PTR( FLA_ONE );
44 
45  bl1_ssetmr( blis_uplo,
46  m_A,
47  n_A,
48  buff_0,
49  buff_A, rs_A, cs_A );
50 
51  if ( diag == FLA_UNIT_DIAG )
52  bl1_ssetdiag( 0,
53  m_A,
54  n_A,
55  buff_1,
56  buff_A, rs_A, cs_A );
57  else if ( diag == FLA_ZERO_DIAG )
58  bl1_ssetdiag( 0,
59  m_A,
60  n_A,
61  buff_0,
62  buff_A, rs_A, cs_A );
63 
64  break;
65  }
66 
67  case FLA_DOUBLE:
68  {
69  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
70  double *buff_0 = ( double * ) FLA_DOUBLE_PTR( FLA_ZERO );
71  double *buff_1 = ( double * ) FLA_DOUBLE_PTR( FLA_ONE );
72 
73  bl1_dsetmr( blis_uplo,
74  m_A,
75  n_A,
76  buff_0,
77  buff_A, rs_A, cs_A );
78 
79  if ( diag == FLA_UNIT_DIAG )
80  bl1_dsetdiag( 0,
81  m_A,
82  n_A,
83  buff_1,
84  buff_A, rs_A, cs_A );
85  else if ( diag == FLA_ZERO_DIAG )
86  bl1_dsetdiag( 0,
87  m_A,
88  n_A,
89  buff_0,
90  buff_A, rs_A, cs_A );
91 
92  break;
93  }
94 
95  case FLA_COMPLEX:
96  {
97  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
98  scomplex *buff_0 = ( scomplex * ) FLA_COMPLEX_PTR( FLA_ZERO );
99  scomplex *buff_1 = ( scomplex * ) FLA_COMPLEX_PTR( FLA_ONE );
100 
101  bl1_csetmr( blis_uplo,
102  m_A,
103  n_A,
104  buff_0,
105  buff_A, rs_A, cs_A );
106 
107  if ( diag == FLA_UNIT_DIAG )
108  bl1_csetdiag( 0,
109  m_A,
110  n_A,
111  buff_1,
112  buff_A, rs_A, cs_A );
113  else if ( diag == FLA_ZERO_DIAG )
114  bl1_csetdiag( 0,
115  m_A,
116  n_A,
117  buff_0,
118  buff_A, rs_A, cs_A );
119 
120  break;
121  }
122 
123  case FLA_DOUBLE_COMPLEX:
124  {
125  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
126  dcomplex *buff_0 = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( FLA_ZERO );
127  dcomplex *buff_1 = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( FLA_ONE );
128 
129  bl1_zsetmr( blis_uplo,
130  m_A,
131  n_A,
132  buff_0,
133  buff_A, rs_A, cs_A );
134 
135  if ( diag == FLA_UNIT_DIAG )
136  bl1_zsetdiag( 0,
137  m_A,
138  n_A,
139  buff_1,
140  buff_A, rs_A, cs_A );
141  else if ( diag == FLA_ZERO_DIAG )
142  bl1_zsetdiag( 0,
143  m_A,
144  n_A,
145  buff_0,
146  buff_A, rs_A, cs_A );
147 
148  break;
149  }
150 
151  }
152 
153  return FLA_SUCCESS;
154 }
void bl1_dsetmr(uplo1_t uplo, int m, int n, double *sigma, double *a, int a_rs, int a_cs)
Definition: bl1_setmr.c:66
uplo1_t
Definition: blis_type_defs.h:60
void bl1_ssetmr(uplo1_t uplo, int m, int n, float *sigma, float *a, int a_rs, int a_cs)
Definition: bl1_setmr.c:13
void bl1_ssetdiag(int offset, int m, int n, float *sigma, float *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:34
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
void bl1_dsetdiag(int offset, int m, int n, double *sigma, double *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:55
FLA_Error FLA_Triangularize_check(FLA_Uplo uplo, FLA_Diag diag, FLA_Obj A)
Definition: FLA_Triangularize_check.c:13
void bl1_zsetmr(uplo1_t uplo, int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_setmr.c:172
FLA_Obj FLA_ONE
Definition: FLA_Init.c:18
void bl1_zsetdiag(int offset, int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:98
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void bl1_csetmr(uplo1_t uplo, int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
Definition: bl1_setmr.c:119
void FLA_Param_map_flame_to_blis_uplo(FLA_Uplo uplo, uplo1_t *blis_uplo)
Definition: FLA_Param.c:285
Definition: blis_type_defs.h:132
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int FLA_Datatype
Definition: FLA_type_defs.h:49
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
void bl1_csetdiag(int offset, int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
Definition: bl1_setdiag.c:76
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
FLA_Obj FLA_ZERO
Definition: FLA_Init.c:20
Definition: blis_type_defs.h:137

◆ FLA_Triangularize_check()

FLA_Error FLA_Triangularize_check ( FLA_Uplo  uplo,
FLA_Diag  diag,
FLA_Obj  A 
)

References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_valid_diag(), and FLA_Check_valid_uplo().

Referenced by FLA_Triangularize().

14 {
15  FLA_Error e_val;
16 
17  e_val = FLA_Check_valid_uplo( uplo );
18  FLA_Check_error_code( e_val );
19 
20  e_val = FLA_Check_valid_diag( diag );
21  FLA_Check_error_code( e_val );
22 
23  e_val = FLA_Check_floating_object( A );
24  FLA_Check_error_code( e_val );
25 
26  e_val = FLA_Check_nonconstant_object( A );
27  FLA_Check_error_code( e_val );
28 
29  return FLA_SUCCESS;
30 }
FLA_Error FLA_Check_valid_diag(FLA_Diag diag)
Definition: FLA_Check.c:100
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Check_nonconstant_object(FLA_Obj A)
Definition: FLA_Check.c:954
FLA_Error FLA_Check_floating_object(FLA_Obj A)
Definition: FLA_Check.c:232
FLA_Error FLA_Check_valid_uplo(FLA_Uplo uplo)
Definition: FLA_Check.c:76