LAPACK  3.7.1
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  /* Optionally check input matrices for NaNs */
54  if( LAPACKE_sge_nancheck( matrix_layout, m, m, a, lda ) ) {
55  return -6;
56  }
57  if( LAPACKE_sge_nancheck( matrix_layout, n, n, b, ldb ) ) {
58  return -8;
59  }
60  if( LAPACKE_sge_nancheck( matrix_layout, m, n, c, ldc ) ) {
61  return -10;
62  }
63  if( LAPACKE_sge_nancheck( matrix_layout, m, m, d, ldd ) ) {
64  return -12;
65  }
66  if( LAPACKE_sge_nancheck( matrix_layout, n, n, e, lde ) ) {
67  return -14;
68  }
69  if( LAPACKE_sge_nancheck( matrix_layout, m, n, f, ldf ) ) {
70  return -16;
71  }
72 #endif
73  /* Allocate memory for working array(s) */
74  iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,m+n+6) );
75  if( iwork == NULL ) {
77  goto exit_level_0;
78  }
79  /* Query optimal working array(s) size */
80  info = LAPACKE_stgsyl_work( matrix_layout, trans, ijob, m, n, a, lda, b, ldb,
81  c, ldc, d, ldd, e, lde, f, ldf, scale, dif,
82  &work_query, lwork, iwork );
83  if( info != 0 ) {
84  goto exit_level_1;
85  }
86  lwork = (lapack_int)work_query;
87  /* Allocate memory for work arrays */
88  work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
89  if( work == NULL ) {
91  goto exit_level_1;
92  }
93  /* Call middle-level interface */
94  info = LAPACKE_stgsyl_work( matrix_layout, trans, ijob, m, n, a, lda, b, ldb,
95  c, ldc, d, ldd, e, lde, f, ldf, scale, dif,
96  work, lwork, iwork );
97  /* Release memory and exit */
98  LAPACKE_free( work );
99 exit_level_1:
100  LAPACKE_free( iwork );
101 exit_level_0:
102  if( info == LAPACK_WORK_MEMORY_ERROR ) {
103  LAPACKE_xerbla( "LAPACKE_stgsyl", info );
104  }
105  return info;
106 }
#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
Here is the call graph for this function: