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

Go to the source code of this file.

Functions

lapack_int LAPACKE_cunbdb (int matrix_layout, char trans, char signs, lapack_int m, lapack_int p, lapack_int q, lapack_complex_float *x11, lapack_int ldx11, lapack_complex_float *x12, lapack_int ldx12, lapack_complex_float *x21, lapack_int ldx21, lapack_complex_float *x22, lapack_int ldx22, float *theta, float *phi, lapack_complex_float *taup1, lapack_complex_float *taup2, lapack_complex_float *tauq1, lapack_complex_float *tauq2)

Function Documentation

◆ LAPACKE_cunbdb()

lapack_int LAPACKE_cunbdb ( int matrix_layout,
char trans,
char signs,
lapack_int m,
lapack_int p,
lapack_int q,
lapack_complex_float * x11,
lapack_int ldx11,
lapack_complex_float * x12,
lapack_int ldx12,
lapack_complex_float * x21,
lapack_int ldx21,
lapack_complex_float * x22,
lapack_int ldx22,
float * theta,
float * phi,
lapack_complex_float * taup1,
lapack_complex_float * taup2,
lapack_complex_float * tauq1,
lapack_complex_float * tauq2 )

Definition at line 35 of file lapacke_cunbdb.c.

46{
47 lapack_int info = 0;
48 lapack_int lwork = -1;
49 lapack_complex_float* work = NULL;
50 lapack_complex_float work_query;
51 int lapack_layout;
52 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
53 LAPACKE_xerbla( "LAPACKE_cunbdb", -1 );
54 return -1;
55 }
56 if( LAPACKE_lsame( trans, 'n' ) && matrix_layout == LAPACK_COL_MAJOR ) {
57 lapack_layout = LAPACK_COL_MAJOR;
58 } else {
59 lapack_layout = LAPACK_ROW_MAJOR;
60 }
61#ifndef LAPACK_DISABLE_NAN_CHECK
62 if( LAPACKE_get_nancheck() ) {
63 /* Optionally check input matrices for NaNs */
64 if( LAPACKE_cge_nancheck( lapack_layout, p, q, x11, ldx11 ) ) {
65 return -7;
66 }
67 if( LAPACKE_cge_nancheck( lapack_layout, p, m-q, x12, ldx12 ) ) {
68 return -9;
69 }
70 if( LAPACKE_cge_nancheck( lapack_layout, m-p, q, x21, ldx21 ) ) {
71 return -11;
72 }
73 if( LAPACKE_cge_nancheck( lapack_layout, m-p, m-q, x22, ldx22 ) ) {
74 return -13;
75 }
76 }
77#endif
78 /* Query optimal working array(s) size */
79 info = LAPACKE_cunbdb_work( matrix_layout, trans, signs, m, p, q, x11, ldx11,
80 x12, ldx12, x21, ldx21, x22, ldx22, theta, phi,
81 taup1, taup2, tauq1, tauq2, &work_query,
82 lwork );
83 if( info != 0 ) {
84 goto exit_level_0;
85 }
86 lwork = LAPACK_C2INT( work_query );
87 /* Allocate memory for work arrays */
88 work = (lapack_complex_float*)
89 LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
90 if( work == NULL ) {
92 goto exit_level_0;
93 }
94 /* Call middle-level interface */
95 info = LAPACKE_cunbdb_work( matrix_layout, trans, signs, m, p, q, x11, ldx11,
96 x12, ldx12, x21, ldx21, x22, ldx22, theta, phi,
97 taup1, taup2, tauq1, tauq2, work, lwork );
98 /* Release memory and exit */
99 LAPACKE_free( work );
100exit_level_0:
101 if( info == LAPACK_WORK_MEMORY_ERROR ) {
102 LAPACKE_xerbla( "LAPACKE_cunbdb", info );
103 }
104 return info;
105}
#define lapack_int
Definition lapack.h:83
#define lapack_complex_float
Definition lapack.h:45
lapack_int LAPACKE_cunbdb_work(int matrix_layout, char trans, char signs, lapack_int m, lapack_int p, lapack_int q, lapack_complex_float *x11, lapack_int ldx11, lapack_complex_float *x12, lapack_int ldx12, lapack_complex_float *x21, lapack_int ldx21, lapack_complex_float *x22, lapack_int ldx22, float *theta, float *phi, lapack_complex_float *taup1, lapack_complex_float *taup2, lapack_complex_float *tauq1, lapack_complex_float *tauq2, lapack_complex_float *work, lapack_int lwork)
#define LAPACK_WORK_MEMORY_ERROR
Definition lapacke.h:55
#define LAPACK_COL_MAJOR
Definition lapacke.h:53
#define LAPACK_C2INT(x)
Definition lapacke.h:49
#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
lapack_logical LAPACKE_lsame(char ca, char cb)
void LAPACKE_xerbla(const char *name, lapack_int info)
lapack_logical LAPACKE_cge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_float *a, lapack_int lda)