libflame  revision_anchor
Functions
FLA_Random_matrix.c File Reference

(r)

Functions

FLA_Error FLA_Random_matrix (FLA_Obj A)
 

Function Documentation

◆ FLA_Random_matrix()

FLA_Error FLA_Random_matrix ( FLA_Obj  A)
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 }
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
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
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
int FLA_Datatype
Definition: FLA_type_defs.h:49
void bl1_srandm(int m, int n, float *a, int a_rs, int a_cs)
Definition: bl1_randm.c:13
void bl1_zrandm(int m, int n, dcomplex *a, int a_rs, int a_cs)
Definition: bl1_randm.c:115
void bl1_crandm(int m, int n, scomplex *a, int a_rs, int a_cs)
Definition: bl1_randm.c:81
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:138
Definition: blis_type_defs.h:133

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