LAPACK  3.7.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 36 of file lapacke_sorbdb.c.

43 {
44  lapack_int info = 0;
45  lapack_int lwork = -1;
46  float* work = NULL;
47  float work_query;
48  int lapack_layout;
49  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
50  LAPACKE_xerbla( "LAPACKE_sorbdb", -1 );
51  return -1;
52  }
53  if( LAPACKE_lsame( trans, 'n' ) && matrix_layout == LAPACK_COL_MAJOR ) {
54  lapack_layout = LAPACK_COL_MAJOR;
55  } else {
56  lapack_layout = LAPACK_ROW_MAJOR;
57  }
58 #ifndef LAPACK_DISABLE_NAN_CHECK
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 #endif
73  /* Query optimal working array(s) size */
74  info = LAPACKE_sorbdb_work( matrix_layout, trans, signs, m, p, q, x11, ldx11,
75  x12, ldx12, x21, ldx21, x22, ldx22, theta, phi,
76  taup1, taup2, tauq1, tauq2, &work_query,
77  lwork );
78  if( info != 0 ) {
79  goto exit_level_0;
80  }
81  lwork = (lapack_int)work_query;
82  /* Allocate memory for work arrays */
83  work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
84  if( work == NULL ) {
86  goto exit_level_0;
87  }
88  /* Call middle-level interface */
89  info = LAPACKE_sorbdb_work( matrix_layout, trans, signs, m, p, q, x11, ldx11,
90  x12, ldx12, x21, ldx21, x22, ldx22, theta, phi,
91  taup1, taup2, tauq1, tauq2, work, lwork );
92  /* Release memory and exit */
93  LAPACKE_free( work );
94 exit_level_0:
95  if( info == LAPACK_WORK_MEMORY_ERROR ) {
96  LAPACKE_xerbla( "LAPACKE_sorbdb", info );
97  }
98  return info;
99 }
#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_logical LAPACKE_sge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const float *a, lapack_int lda)
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:110
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:36
#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: