libflame  revision_anchor
Functions
FLA_Random_tri_matrix.c File Reference

(r)

Functions

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

Function Documentation

◆ FLA_Random_tri_matrix()

FLA_Error FLA_Random_tri_matrix ( FLA_Uplo  uplo,
FLA_Diag  diag,
FLA_Obj  A 
)
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 }
FLA_Error FLA_Random_tri_matrix_check(FLA_Uplo uplo, FLA_Diag diag, FLA_Obj A)
Definition: FLA_Random_tri_matrix_check.c:13
void FLA_Param_map_flame_to_blis_diag(FLA_Diag diag, diag1_t *blis_diag)
Definition: FLA_Param.c:317
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
void FLA_Param_map_flame_to_blis_uplo(FLA_Uplo uplo, uplo1_t *blis_uplo)
Definition: FLA_Param.c:285
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
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_crandmr(uplo1_t uplo, diag1_t diag, int m, int n, scomplex *a, int a_rs, int a_cs)
Definition: bl1_randmr.c:255
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
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
uplo1_t
Definition: blis_type_defs.h:61
diag1_t
Definition: blis_type_defs.h:73
Definition: blis_type_defs.h:138
Definition: blis_type_defs.h:133

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().