LAPACK  3.9.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_sorbdb()

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

Definition at line 35 of file lapacke_sorbdb.c.

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