LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
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 at line 36 of file lapacke_sbdsvdx_work.c.

42 {
43  lapack_int info = 0;
44  if( matrix_layout == LAPACK_COL_MAJOR ) {
45  /* Call LAPACK function and adjust info */
46  LAPACK_sbdsvdx( &uplo, &jobz, &range, &n, d, e, &vl, &vu,
47  &il, &iu, ns, s, z, &ldz,
48  work, iwork, &info );
49  if( info < 0 ) {
50  info = info - 1;
51  }
52  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
53  lapack_int nrows_z = ( LAPACKE_lsame( jobz, 'v' ) ) ? 2*n : 0;
54  lapack_int ncols_z = ( LAPACKE_lsame( jobz, 'v' ) ) ?
55  ( LAPACKE_lsame( range, 'i' ) ? MAX(0,iu - il + 1) : n + 1 ) : 0;
56  lapack_int ldz_t = MAX(1,nrows_z);
57  float* z_t = NULL;
58  /* Check leading dimension(s) */
59  if( ldz < ncols_z ) {
60  info = -3;
61  LAPACKE_xerbla( "LAPACKE_sbdsvdx_work", info );
62  return info;
63  }
64  /* Allocate memory for temporary array(s) */
65  if( LAPACKE_lsame( jobz, 'v' ) ) {
66  z_t = (float*)
67  LAPACKE_malloc( sizeof(float) * ldz_t * MAX(2*n,1) );
68  if( z_t == NULL ) {
70  goto exit_level_0;
71  }
72  }
73  /* Call LAPACK function and adjust info */
74  LAPACK_sbdsvdx( &uplo, &jobz, &range, &n, d, e, &vl, &vu,
75  &il, &iu, ns, s, z_t, &ldz_t, work,
76  iwork, &info );
77  if( info < 0 ) {
78  info = info - 1;
79  }
80  /* Transpose output matrices */
81  if( LAPACKE_lsame( jobz, 'v' ) ) {
82  LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrows_z, ncols_z, z_t, ldz_t, z, ldz);
83  }
84  /* Release memory and exit */
85  if( LAPACKE_lsame( jobz, 'v' ) ) {
86  LAPACKE_free( z_t );
87  }
88 exit_level_0:
89  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
90  LAPACKE_xerbla( "LAPACKE_sbdsvdx_work", info );
91  }
92  } else {
93  info = -1;
94  LAPACKE_xerbla( "LAPACKE_sbdsvdx_work", info );
95  }
96  return info;
97 }
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
void LAPACKE_sge_trans(int matrix_layout, lapack_int m, lapack_int n, const float *in, lapack_int ldin, float *out, lapack_int ldout)
#define MAX(x, y)
Definition: lapacke_utils.h:47
#define LAPACKE_free(p)
Definition: lapacke.h:113
#define LAPACKE_malloc(size)
Definition: lapacke.h:110
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:36
void LAPACK_sbdsvdx(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, lapack_int *info)
#define LAPACK_COL_MAJOR
Definition: lapacke.h:120
void LAPACKE_xerbla(const char *name, lapack_int info)
#define lapack_int
Definition: lapacke.h:47
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:123

Here is the call graph for this function:

Here is the caller graph for this function: