LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_sbdsvdx()

lapack_int LAPACKE_sbdsvdx ( int  matrix_layout,
char  uplo,
char  jobz,
char  range,
lapack_int  n,
float *  d,
float *  e,
float  vl,
float  vu,
lapack_int  il,
lapack_int  iu,
lapack_int ns,
float *  s,
float *  z,
lapack_int  ldz,
lapack_int superb 
)

Definition at line 35 of file lapacke_sbdsvdx.c.

42 {
43  lapack_int info = 0;
44  lapack_int lwork = MAX(14*n,1);
45  float* work = NULL;
46  lapack_int* iwork = NULL;
47  lapack_int i;
48  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
49  LAPACKE_xerbla( "LAPACKE_sbdsvdx", -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_s_nancheck( n, d, 1 ) ) {
56  return -6;
57  }
58  if( LAPACKE_s_nancheck( n - 1, e, 1 ) ) {
59  return -7;
60  }
61  }
62 #endif
63  /* Allocate memory for work arrays */
64  work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
65  if( work == NULL ) {
67  goto exit_level_0;
68  }
69  iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(12*n,1) );
70  if( iwork == NULL ) {
72  goto exit_level_1;
73  }
74  /* Call middle-level interface */
75  info = LAPACKE_sbdsvdx_work( matrix_layout, uplo, jobz, range,
76  n, d, e, vl, vu, il, iu, ns, s, z,
77  ldz, work, iwork);
78  /* Backup significant data from working array(s) */
79  for( i=0; i<12*n-1; i++ ) {
80  superb[i] = iwork[i+1];
81  }
82  /* Release memory and exit */
83  LAPACKE_free( iwork );
84 exit_level_1:
85  LAPACKE_free( work );
86 exit_level_0:
87  if( info == LAPACK_WORK_MEMORY_ERROR ) {
88  LAPACKE_xerbla( "LAPACKE_sbdsvdx", info );
89  }
90  return info;
Here is the call graph for this function:
LAPACKE_free
#define LAPACKE_free(p)
Definition: lapacke.h:47
lapack_int
#define lapack_int
Definition: lapack.h:21
LAPACKE_sbdsvdx_work
lapack_int LAPACKE_sbdsvdx_work(int matrix_layout, char uplo, char jobz, char range, lapack_int n, float *d, float *e, float vl, float vu, lapack_int il, lapack_int iu, lapack_int *ns, float *s, float *z, lapack_int ldz, float *work, lapack_int *iwork)
Definition: lapacke_sbdsvdx_work.c:35
LAPACKE_s_nancheck
lapack_logical LAPACKE_s_nancheck(lapack_int n, const float *x, lapack_int incx)
Definition: lapacke_s_nancheck.c:36
LAPACK_WORK_MEMORY_ERROR
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:56
LAPACKE_xerbla
void LAPACKE_xerbla(const char *name, lapack_int info)
Definition: lapacke_xerbla.c:36
MAX
#define MAX(x, y)
Definition: lapacke_utils.h:47
LAPACKE_malloc
#define LAPACKE_malloc(size)
Definition: lapacke.h:44
LAPACKE_get_nancheck
int LAPACKE_get_nancheck()
Definition: lapacke_nancheck.c:42
LAPACK_ROW_MAJOR
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:53
LAPACK_COL_MAJOR
#define LAPACK_COL_MAJOR
Definition: lapacke.h:54