libflame  revision_anchor
Functions
FLA_Set_offdiag.c File Reference

(r)

Functions

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

Function Documentation

◆ 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