OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
lapacke_stgsyl.c File Reference
#include "lapacke_utils.h"

Go to the source code of this file.

Functions

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)

Function Documentation

◆ 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 35 of file lapacke_stgsyl.c.

41{
42 lapack_int info = 0;
43 lapack_int lwork = -1;
44 lapack_int* iwork = NULL;
45 float* work = NULL;
46 float work_query;
47 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
48 LAPACKE_xerbla( "LAPACKE_stgsyl", -1 );
49 return -1;
50 }
51#ifndef LAPACK_DISABLE_NAN_CHECK
52 if( LAPACKE_get_nancheck() ) {
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 }
73#endif
74 /* Allocate memory for working array(s) */
75 iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,m+n+6) );
76 if( iwork == NULL ) {
78 goto exit_level_0;
79 }
80 /* Query optimal working array(s) size */
81 info = LAPACKE_stgsyl_work( matrix_layout, trans, ijob, m, n, a, lda, b, ldb,
82 c, ldc, d, ldd, e, lde, f, ldf, scale, dif,
83 &work_query, lwork, iwork );
84 if( info != 0 ) {
85 goto exit_level_1;
86 }
87 lwork = (lapack_int)work_query;
88 /* Allocate memory for work arrays */
89 work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
90 if( work == NULL ) {
92 goto exit_level_1;
93 }
94 /* Call middle-level interface */
95 info = LAPACKE_stgsyl_work( matrix_layout, trans, ijob, m, n, a, lda, b, ldb,
96 c, ldc, d, ldd, e, lde, f, ldf, scale, dif,
97 work, lwork, iwork );
98 /* Release memory and exit */
99 LAPACKE_free( work );
100exit_level_1:
101 LAPACKE_free( iwork );
102exit_level_0:
103 if( info == LAPACK_WORK_MEMORY_ERROR ) {
104 LAPACKE_xerbla( "LAPACKE_stgsyl", info );
105 }
106 return info;
107}
logical function lde(ri, rj, lr)
Definition dblat2.f:2942
#define lapack_int
Definition lapack.h:83
#define LAPACK_WORK_MEMORY_ERROR
Definition lapacke.h:55
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)
#define LAPACK_COL_MAJOR
Definition lapacke.h:53
#define LAPACKE_free(p)
Definition lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition lapacke.h:52
int LAPACKE_get_nancheck(void)
#define LAPACKE_malloc(size)
Definition lapacke.h:43
void LAPACKE_xerbla(const char *name, lapack_int info)
lapack_logical LAPACKE_sge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const float *a, lapack_int lda)
#define MAX(x, y)
n