LAPACK  3.8.0
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  if( LAPACKE_get_nancheck() ) {
60  /* Optionally check input matrices for NaNs */
61  if( LAPACKE_sge_nancheck( lapack_layout, p, q, x11, ldx11 ) ) {
62  return -7;
63  }
64  if( LAPACKE_sge_nancheck( lapack_layout, p, m-q, x12, ldx12 ) ) {
65  return -9;
66  }
67  if( LAPACKE_sge_nancheck( lapack_layout, m-p, q, x21, ldx21 ) ) {
68  return -11;
69  }
70  if( LAPACKE_sge_nancheck( lapack_layout, m-p, m-q, x22, ldx22 ) ) {
71  return -13;
72  }
73  }
74 #endif
75  /* Query optimal working array(s) size */
76  info = LAPACKE_sorbdb_work( matrix_layout, trans, signs, m, p, q, x11, ldx11,
77  x12, ldx12, x21, ldx21, x22, ldx22, theta, phi,
78  taup1, taup2, tauq1, tauq2, &work_query,
79  lwork );
80  if( info != 0 ) {
81  goto exit_level_0;
82  }
83  lwork = (lapack_int)work_query;
84  /* Allocate memory for work arrays */
85  work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
86  if( work == NULL ) {
88  goto exit_level_0;
89  }
90  /* Call middle-level interface */
91  info = LAPACKE_sorbdb_work( matrix_layout, trans, signs, m, p, q, x11, ldx11,
92  x12, ldx12, x21, ldx21, x22, ldx22, theta, phi,
93  taup1, taup2, tauq1, tauq2, work, lwork );
94  /* Release memory and exit */
95  LAPACKE_free( work );
96 exit_level_0:
97  if( info == LAPACK_WORK_MEMORY_ERROR ) {
98  LAPACKE_xerbla( "LAPACKE_sorbdb", info );
99  }
100  return info;
101 }
#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
int LAPACKE_get_nancheck()
Here is the call graph for this function: