LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_stgsyl()

lapack_int LAPACKE_stgsyl ( int  matrix_layout,
char  trans,
lapack_int  ijob,
lapack_int  m,
lapack_int  n,
const float *  a,
lapack_int  lda,
const float *  b,
lapack_int  ldb,
float *  c,
lapack_int  ldc,
const float *  d,
lapack_int  ldd,
const float *  e,
lapack_int  lde,
float *  f,
lapack_int  ldf,
float *  scale,
float *  dif 
)

Definition at line 36 of file lapacke_stgsyl.c.

42 {
43  lapack_int info = 0;
44  lapack_int lwork = -1;
45  lapack_int* iwork = NULL;
46  float* work = NULL;
47  float work_query;
48  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
49  LAPACKE_xerbla( "LAPACKE_stgsyl", -1 );
50  return -1;
51  }
52 #ifndef LAPACK_DISABLE_NAN_CHECK
53  if( LAPACKE_get_nancheck() ) {
54  /* Optionally check input matrices for NaNs */
55  if( LAPACKE_sge_nancheck( matrix_layout, m, m, a, lda ) ) {
56  return -6;
57  }
58  if( LAPACKE_sge_nancheck( matrix_layout, n, n, b, ldb ) ) {
59  return -8;
60  }
61  if( LAPACKE_sge_nancheck( matrix_layout, m, n, c, ldc ) ) {
62  return -10;
63  }
64  if( LAPACKE_sge_nancheck( matrix_layout, m, m, d, ldd ) ) {
65  return -12;
66  }
67  if( LAPACKE_sge_nancheck( matrix_layout, n, n, e, lde ) ) {
68  return -14;
69  }
70  if( LAPACKE_sge_nancheck( matrix_layout, m, n, f, ldf ) ) {
71  return -16;
72  }
73  }
74 #endif
75  /* Allocate memory for working array(s) */
76  iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,m+n+6) );
77  if( iwork == NULL ) {
79  goto exit_level_0;
80  }
81  /* Query optimal working array(s) size */
82  info = LAPACKE_stgsyl_work( matrix_layout, trans, ijob, m, n, a, lda, b, ldb,
83  c, ldc, d, ldd, e, lde, f, ldf, scale, dif,
84  &work_query, lwork, iwork );
85  if( info != 0 ) {
86  goto exit_level_1;
87  }
88  lwork = (lapack_int)work_query;
89  /* Allocate memory for work arrays */
90  work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
91  if( work == NULL ) {
93  goto exit_level_1;
94  }
95  /* Call middle-level interface */
96  info = LAPACKE_stgsyl_work( matrix_layout, trans, ijob, m, n, a, lda, b, ldb,
97  c, ldc, d, ldd, e, lde, f, ldf, scale, dif,
98  work, lwork, iwork );
99  /* Release memory and exit */
100  LAPACKE_free( work );
101 exit_level_1:
102  LAPACKE_free( iwork );
103 exit_level_0:
104  if( info == LAPACK_WORK_MEMORY_ERROR ) {
105  LAPACKE_xerbla( "LAPACKE_stgsyl", info );
106  }
107  return info;
108 }
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:122
#define LAPACKE_free(p)
Definition: lapacke.h:113
lapack_int LAPACKE_stgsyl_work(int matrix_layout, char trans, lapack_int ijob, lapack_int m, lapack_int n, const float *a, lapack_int lda, const float *b, lapack_int ldb, float *c, lapack_int ldc, const float *d, lapack_int ldd, const float *e, lapack_int lde, float *f, lapack_int ldf, float *scale, float *dif, float *work, lapack_int lwork, lapack_int *iwork)
logical function lde(RI, RJ, LR)
Definition: dblat2.f:2945
lapack_logical LAPACKE_sge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const float *a, lapack_int lda)
#define MAX(x, y)
Definition: lapacke_utils.h:47
#define LAPACKE_malloc(size)
Definition: lapacke.h:110
#define LAPACK_COL_MAJOR
Definition: lapacke.h:120
void LAPACKE_xerbla(const char *name, lapack_int info)
#define lapack_int
Definition: lapacke.h:47
int LAPACKE_get_nancheck()
Here is the call graph for this function: