LAPACK  3.9.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_dstein_work()

lapack_int LAPACKE_dstein_work ( int  matrix_layout,
lapack_int  n,
const double *  d,
const double *  e,
lapack_int  m,
const double *  w,
const lapack_int iblock,
const lapack_int isplit,
double *  z,
lapack_int  ldz,
double *  work,
lapack_int iwork,
lapack_int ifailv 
)

Definition at line 35 of file lapacke_dstein_work.c.

41 {
42  lapack_int info = 0;
43  if( matrix_layout == LAPACK_COL_MAJOR ) {
44  /* Call LAPACK function and adjust info */
45  LAPACK_dstein( &n, d, e, &m, w, iblock, isplit, z, &ldz, work, iwork,
46  ifailv, &info );
47  if( info < 0 ) {
48  info = info - 1;
49  }
50  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
51  lapack_int ldz_t = MAX(1,n);
52  double* z_t = NULL;
53  /* Check leading dimension(s) */
54  if( ldz < m ) {
55  info = -10;
56  LAPACKE_xerbla( "LAPACKE_dstein_work", info );
57  return info;
58  }
59  /* Allocate memory for temporary array(s) */
60  z_t = (double*)LAPACKE_malloc( sizeof(double) * ldz_t * MAX(1,m) );
61  if( z_t == NULL ) {
63  goto exit_level_0;
64  }
65  /* Call LAPACK function and adjust info */
66  LAPACK_dstein( &n, d, e, &m, w, iblock, isplit, z_t, &ldz_t, work,
67  iwork, ifailv, &info );
68  if( info < 0 ) {
69  info = info - 1;
70  }
71  /* Transpose output matrices */
72  LAPACKE_dge_trans( LAPACK_COL_MAJOR, n, m, z_t, ldz_t, z, ldz );
73  /* Release memory and exit */
74  LAPACKE_free( z_t );
75 exit_level_0:
76  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
77  LAPACKE_xerbla( "LAPACKE_dstein_work", info );
78  }
79  } else {
80  info = -1;
81  LAPACKE_xerbla( "LAPACKE_dstein_work", info );
82  }
83  return info;
84 }
void LAPACK_dstein(lapack_int const *n, double const *D, double const *E, lapack_int const *m, double const *W, lapack_int const *IBLOCK, lapack_int const *ISPLIT, double *Z, lapack_int const *ldz, double *work, lapack_int *iwork, lapack_int *IFAIL, lapack_int *info)
#define lapack_int
Definition: lapack.h:83
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACKE_free(p)
Definition: lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:52
#define LAPACKE_malloc(size)
Definition: lapacke.h:43
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:56
void LAPACKE_xerbla(const char *name, lapack_int info)
#define MAX(x, y)
Definition: lapacke_utils.h:46
void LAPACKE_dge_trans(int matrix_layout, lapack_int m, lapack_int n, const double *in, lapack_int ldin, double *out, lapack_int ldout)
Here is the call graph for this function:
Here is the caller graph for this function: