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

Go to the source code of this file.

Functions

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

Function Documentation

◆ LAPACKE_dtgsyl()

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

Definition at line 35 of file lapacke_dtgsyl.c.

42{
43 lapack_int info = 0;
44 lapack_int lwork = -1;
45 lapack_int* iwork = NULL;
46 double* work = NULL;
47 double work_query;
48 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
49 LAPACKE_xerbla( "LAPACKE_dtgsyl", -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_dge_nancheck( matrix_layout, m, m, a, lda ) ) {
56 return -6;
57 }
58 if( LAPACKE_dge_nancheck( matrix_layout, n, n, b, ldb ) ) {
59 return -8;
60 }
61 if( LAPACKE_dge_nancheck( matrix_layout, m, n, c, ldc ) ) {
62 return -10;
63 }
64 if( LAPACKE_dge_nancheck( matrix_layout, m, m, d, ldd ) ) {
65 return -12;
66 }
67 if( LAPACKE_dge_nancheck( matrix_layout, n, n, e, lde ) ) {
68 return -14;
69 }
70 if( LAPACKE_dge_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_dtgsyl_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 = (double*)LAPACKE_malloc( sizeof(double) * lwork );
91 if( work == NULL ) {
93 goto exit_level_1;
94 }
95 /* Call middle-level interface */
96 info = LAPACKE_dtgsyl_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 );
101exit_level_1:
102 LAPACKE_free( iwork );
103exit_level_0:
104 if( info == LAPACK_WORK_MEMORY_ERROR ) {
105 LAPACKE_xerbla( "LAPACKE_dtgsyl", info );
106 }
107 return info;
108}
logical function lde(ri, rj, lr)
Definition dblat2.f:2942
#define lapack_int
Definition lapack.h:83
lapack_int LAPACKE_dtgsyl_work(int matrix_layout, char trans, lapack_int ijob, lapack_int m, lapack_int n, const double *a, lapack_int lda, const double *b, lapack_int ldb, double *c, lapack_int ldc, const double *d, lapack_int ldd, const double *e, lapack_int lde, double *f, lapack_int ldf, double *scale, double *dif, double *work, lapack_int lwork, lapack_int *iwork)
#define LAPACK_WORK_MEMORY_ERROR
Definition lapacke.h:55
#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)
#define MAX(x, y)
lapack_logical LAPACKE_dge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const double *a, lapack_int lda)
n