LAPACK  3.10.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.

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