Fix C prototypes and LAPACKE headers for ?GEDMD/?GEDMDQ (#4134)
* Fix prototypes for ?GEDMD/?GEDMDQ and their LAPACKE interfaces
This commit is contained in:
parent
49077e7bde
commit
4c43d1eeba
|
@ -3323,68 +3323,107 @@ void LAPACK_zgesdd_base(
|
||||||
#define LAPACK_zgesdd(...) LAPACK_zgesdd_base(__VA_ARGS__)
|
#define LAPACK_zgesdd(...) LAPACK_zgesdd_base(__VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define LAPACK_cgedmd LAPACK_GLOBAL(cgedmd,CGEDMD)
|
#define LAPACK_cgedmd_base LAPACK_GLOBAL(cgedmd,CGEDMD)
|
||||||
void LAPACK_cgedmd(
|
void LAPACK_cgedmd_base(
|
||||||
char const* jobs, char const* jobz, char const* jobf,
|
char const* jobs, char const* jobz, char const* jobr, char const* jobf,
|
||||||
lapack_int const* whtsvd, lapack_int const* m, lapack_int const* n,
|
lapack_int const* whtsvd, lapack_int const* m, lapack_int const* n,
|
||||||
lapack_complex_float* x, lapack_int const* ldx,
|
lapack_complex_float* x, lapack_int const* ldx,
|
||||||
lapack_complex_float* y, lapack_int const* ldy, lapack_int const* k,
|
lapack_complex_float* y, lapack_int const* ldy, lapack_int const* nrnk,
|
||||||
lapack_complex_float* reig, lapack_complex_float* imeig,
|
const float* tol, lapack_int* k, lapack_complex_float* eigs,
|
||||||
lapack_complex_float* z, lapack_int const* ldz, lapack_complex_float* res,
|
lapack_complex_float* z, lapack_int const* ldz, float* res,
|
||||||
lapack_complex_float* b, lapack_int const* ldb,
|
lapack_complex_float* b, lapack_int const* ldb,
|
||||||
lapack_complex_float* w, lapack_int const* ldw,
|
lapack_complex_float* w, lapack_int const* ldw,
|
||||||
lapack_complex_float* s, lapack_int const* lds,
|
lapack_complex_float* s, lapack_int const* lds,
|
||||||
lapack_complex_float* work, lapack_int const* lwork,
|
lapack_complex_float* zwork, lapack_int const* lzwork,
|
||||||
|
float* work, lapack_int const* lwork,
|
||||||
lapack_int* iwork, lapack_int const* liwork,
|
lapack_int* iwork, lapack_int const* liwork,
|
||||||
lapack_int* info );
|
lapack_int* info
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
, size_t, size_t, size_t, size_t
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
#define LAPACK_cgedmd(...) LAPACK_cgedmd_base(__VA_ARGS__, 1, 1, 1, 1)
|
||||||
|
#else
|
||||||
|
#define LAPACK_cgedmd(...) LAPACK_cgedmd_base(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LAPACK_dgedmd LAPACK_GLOBAL(dgedmd,DGEDMD)
|
|
||||||
void LAPACK_dgedmd(
|
#define LAPACK_dgedmd_base LAPACK_GLOBAL(dgedmd,DGEDMD)
|
||||||
char const* jobs, char const* jobz, char const* jobf,
|
void LAPACK_dgedmd_base(
|
||||||
|
char const* jobs, char const* jobz, char const* jobr, char const* jobf,
|
||||||
lapack_int const* whtsvd, lapack_int const* m, lapack_int const* n,
|
lapack_int const* whtsvd, lapack_int const* m, lapack_int const* n,
|
||||||
double* x, lapack_int const* ldx,
|
double* x, lapack_int const* ldx,
|
||||||
double* y, lapack_int const* ldy, lapack_int const* k,
|
double* y, lapack_int const* ldy, lapack_int const* nrnk,
|
||||||
double* reig, double* imeig,
|
const double* tol, lapack_int* k, double* reig, double* imeig,
|
||||||
double* z, lapack_int const* ldz, double* res,
|
double* z, lapack_int const* ldz, double* res,
|
||||||
double* b, lapack_int const* ldb,
|
double* b, lapack_int const* ldb,
|
||||||
double* w, lapack_int const* ldw,
|
double* w, lapack_int const* ldw,
|
||||||
double* s, lapack_int const* lds,
|
double* s, lapack_int const* lds,
|
||||||
double* work, lapack_int const* lwork,
|
double* work, lapack_int const* lwork,
|
||||||
lapack_int* iwork, lapack_int const* liwork,
|
lapack_int* iwork, lapack_int const* liwork,
|
||||||
lapack_int* info );
|
lapack_int* info
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
, size_t, size_t, size_t, size_t
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
#define LAPACK_dgedmd(...) LAPACK_dgedmd_base(__VA_ARGS__, 1, 1, 1, 1)
|
||||||
|
#else
|
||||||
|
#define LAPACK_dgedmd(...) LAPACK_dgedmd_base(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LAPACK_sgedmd LAPACK_GLOBAL(sgedmd,SGEDMD)
|
#define LAPACK_sgedmd_base LAPACK_GLOBAL(sgedmd,SGEDMD)
|
||||||
void LAPACK_sgedmd(
|
void LAPACK_sgedmd_base(
|
||||||
char const* jobs, char const* jobz, char const* jobf,
|
char const* jobs, char const* jobz, char const* jobr, char const* jobf,
|
||||||
lapack_int const* whtsvd, lapack_int const* m, lapack_int const* n,
|
lapack_int const* whtsvd, lapack_int const* m, lapack_int const* n,
|
||||||
float* x, lapack_int const* ldx,
|
float* x, lapack_int const* ldx,
|
||||||
float* y, lapack_int const* ldy, lapack_int const* k,
|
float* y, lapack_int const* ldy, lapack_int const* nrnk,
|
||||||
float* reig, float* imeig,
|
const float* tol, lapack_int* k, float* reig, float *imeig,
|
||||||
float* z, lapack_int const* ldz, float* res,
|
float* z, lapack_int const* ldz, float* res,
|
||||||
float* b, lapack_int const* ldb,
|
float* b, lapack_int const* ldb,
|
||||||
float* w, lapack_int const* ldw,
|
float* w, lapack_int const* ldw,
|
||||||
float* s, lapack_int const* lds,
|
float* s, lapack_int const* lds,
|
||||||
float* work, lapack_int const* lwork,
|
float* work, lapack_int const* lwork,
|
||||||
lapack_int* iwork, lapack_int const* liwork,
|
lapack_int* iwork, lapack_int const* liwork,
|
||||||
lapack_int* info );
|
lapack_int* info
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
, size_t, size_t, size_t, size_t
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
#define LAPACK_sgedmd(...) LAPACK_sgedmd_base(__VA_ARGS__, 1, 1, 1, 1)
|
||||||
|
#else
|
||||||
|
#define LAPACK_sgedmd(...) LAPACK_sgedmd_base(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LAPACK_zgedmd LAPACK_GLOBAL(zgedmd,ZGEDMD)
|
#define LAPACK_zgedmd_base LAPACK_GLOBAL(zgedmd,ZGEDMD)
|
||||||
void LAPACK_zgedmd(
|
void LAPACK_zgedmd_base(
|
||||||
char const* jobs, char const* jobz, char const* jobf,
|
char const* jobs, char const* jobz, char const* jobr, char const* jobf,
|
||||||
lapack_int const* whtsvd, lapack_int const* m, lapack_int const* n,
|
lapack_int const* whtsvd, lapack_int const* m, lapack_int const* n,
|
||||||
lapack_complex_double* x, lapack_int const* ldx,
|
lapack_complex_double* x, lapack_int const* ldx,
|
||||||
lapack_complex_double* y, lapack_int const* ldy, lapack_int const* k,
|
lapack_complex_double* y, lapack_int const* ldy, lapack_int const* nrnk,
|
||||||
lapack_complex_double* reig, lapack_complex_double* imeig,
|
const double* tol, lapack_int *k, lapack_complex_double* eigs,
|
||||||
lapack_complex_double* z, lapack_int const* ldz, lapack_complex_double* res,
|
lapack_complex_double* z, lapack_int const* ldz, double* res,
|
||||||
lapack_complex_double* b, lapack_int const* ldb,
|
lapack_complex_double* b, lapack_int const* ldb,
|
||||||
lapack_complex_double* w, lapack_int const* ldw,
|
lapack_complex_double* w, lapack_int const* ldw,
|
||||||
lapack_complex_double* s, lapack_int const* lds,
|
lapack_complex_double* s, lapack_int const* lds,
|
||||||
lapack_complex_double* work, lapack_int const* lwork,
|
lapack_complex_double* zwork, lapack_int const* lzwork,
|
||||||
|
double* rwork, lapack_int const* lrwork,
|
||||||
lapack_int* iwork, lapack_int const* liwork,
|
lapack_int* iwork, lapack_int const* liwork,
|
||||||
lapack_int* info );
|
lapack_int* info
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
, size_t, size_t, size_t, size_t
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
#define LAPACK_zgedmd(...) LAPACK_zgedmd_base(__VA_ARGS__, 1, 1, 1, 1)
|
||||||
|
#else
|
||||||
|
#define LAPACK_zgedmd(...) LAPACK_zgedmd_base(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LAPACK_cgedmdq LAPACK_GLOBAL(cgedmdq,CGEDMDQ)
|
#define LAPACK_cgedmdq_base LAPACK_GLOBAL(cgedmdq,CGEDMDQ)
|
||||||
void LAPACK_cgedmdq(
|
void LAPACK_cgedmdq_base(
|
||||||
char const* jobs, char const* jobz, char const* jobr, char const* jobq,
|
char const* jobs, char const* jobz, char const* jobr, char const* jobq,
|
||||||
char const* jobt, char const* jobf, lapack_int const* whtsvd,
|
char const* jobt, char const* jobf, lapack_int const* whtsvd,
|
||||||
lapack_int const* m, lapack_int const* n,
|
lapack_int const* m, lapack_int const* n,
|
||||||
|
@ -3392,35 +3431,54 @@ void LAPACK_cgedmdq(
|
||||||
lapack_complex_float* x, lapack_int const* ldx,
|
lapack_complex_float* x, lapack_int const* ldx,
|
||||||
lapack_complex_float* y, lapack_int const* ldy, lapack_int const* nrnk,
|
lapack_complex_float* y, lapack_int const* ldy, lapack_int const* nrnk,
|
||||||
float const* tol, lapack_int const* k,
|
float const* tol, lapack_int const* k,
|
||||||
lapack_complex_float* reig, lapack_complex_float* imeig,
|
lapack_complex_float* eigs,
|
||||||
lapack_complex_float* z, lapack_int const* ldz, lapack_complex_float* res,
|
lapack_complex_float* z, lapack_int const* ldz, float* res,
|
||||||
lapack_complex_float* b, lapack_int const* ldb,
|
lapack_complex_float* b, lapack_int const* ldb,
|
||||||
lapack_complex_float* v, lapack_int const* ldv,
|
lapack_complex_float* v, lapack_int const* ldv,
|
||||||
lapack_complex_float* s, lapack_int const* lds,
|
lapack_complex_float* s, lapack_int const* lds,
|
||||||
lapack_complex_float* work, lapack_int const* lwork,
|
lapack_complex_float* zwork, lapack_int const* lzwork,
|
||||||
|
float* work, lapack_int const* lwork,
|
||||||
lapack_int* iwork, lapack_int const* liwork,
|
lapack_int* iwork, lapack_int const* liwork,
|
||||||
lapack_int* info );
|
lapack_int* info
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
, size_t, size_t, size_t, size_t, size_t, size_t
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
#define LAPACK_cgedmdq(...) LAPACK_cgedmdq_base(__VA_ARGS__, 1, 1, 1, 1, 1, 1)
|
||||||
|
#else
|
||||||
|
#define LAPACK_cgedmdq(...) LAPACK_cgedmdq_base(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LAPACK_dgedmdq LAPACK_GLOBAL(dgedmdq,DGEDMDQ)
|
#define LAPACK_dgedmdq_base LAPACK_GLOBAL(dgedmdq,DGEDMDQ)
|
||||||
void LAPACK_dgedmdq(
|
void LAPACK_dgedmdq_base(
|
||||||
char const* jobs, char const* jobz, char const* jobr, char const* jobq,
|
char const* jobs, char const* jobz, char const* jobr, char const* jobq,
|
||||||
char const* jobt, char const* jobf, lapack_int const* whtsvd,
|
char const* jobt, char const* jobf, lapack_int const* whtsvd,
|
||||||
lapack_int const* m, lapack_int const* n,
|
lapack_int const* m, lapack_int const* n,
|
||||||
double* f, lapack_int const* ldf,
|
double* f, lapack_int const* ldf,
|
||||||
double* x, lapack_int const* ldx,
|
double* x, lapack_int const* ldx,
|
||||||
double* y, lapack_int const* ldy, lapack_int const* nrnk,
|
double* y, lapack_int const* ldy, lapack_int const* nrnk,
|
||||||
double const* tol, lapack_int const* k,
|
double const* tol, lapack_int* k,
|
||||||
double* reig, double* imeig,
|
double* reig, double *imeig,
|
||||||
double* z, lapack_int const* ldz, double* res,
|
double* z, lapack_int const* ldz, double* res,
|
||||||
double* b, lapack_int const* ldb,
|
double* b, lapack_int const* ldb,
|
||||||
double* v, lapack_int const* ldv,
|
double* v, lapack_int const* ldv,
|
||||||
double* s, lapack_int const* lds,
|
double* s, lapack_int const* lds,
|
||||||
double* work, lapack_int const* lwork,
|
double* work, lapack_int const* lwork,
|
||||||
lapack_int* iwork, lapack_int const* liwork,
|
lapack_int* iwork, lapack_int const* liwork,
|
||||||
lapack_int* info );
|
lapack_int* info
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
, size_t, size_t, size_t, size_t, size_t, size_t
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
#define LAPACK_dgedmdq(...) LAPACK_dgedmdq_base(__VA_ARGS__, 1, 1, 1, 1, 1, 1)
|
||||||
|
#else
|
||||||
|
#define LAPACK_dgedmdq(...) LAPACK_dgedmdq_base(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LAPACK_sgedmdq LAPACK_GLOBAL(sgedmdq,SGEDMDQ)
|
#define LAPACK_sgedmdq_base LAPACK_GLOBAL(sgedmdq,SGEDMDQ)
|
||||||
void LAPACK_sgedmdq(
|
void LAPACK_sgedmdq_base(
|
||||||
char const* jobs, char const* jobz, char const* jobr, char const* jobq,
|
char const* jobs, char const* jobz, char const* jobr, char const* jobq,
|
||||||
char const* jobt, char const* jobf, lapack_int const* whtsvd,
|
char const* jobt, char const* jobf, lapack_int const* whtsvd,
|
||||||
lapack_int const* m, lapack_int const* n,
|
lapack_int const* m, lapack_int const* n,
|
||||||
|
@ -3435,10 +3493,19 @@ void LAPACK_sgedmdq(
|
||||||
float* s, lapack_int const* lds,
|
float* s, lapack_int const* lds,
|
||||||
float* work, lapack_int const* lwork,
|
float* work, lapack_int const* lwork,
|
||||||
lapack_int* iwork, lapack_int const* liwork,
|
lapack_int* iwork, lapack_int const* liwork,
|
||||||
lapack_int* info );
|
lapack_int* info
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
, size_t, size_t, size_t, size_t, size_t, size_t
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
#define LAPACK_sgedmdq(...) LAPACK_sgedmdq_base(__VA_ARGS__, 1, 1, 1, 1, 1, 1)
|
||||||
|
#else
|
||||||
|
#define LAPACK_sgedmdq(...) LAPACK_sgedmdq_base(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LAPACK_zgedmdq LAPACK_GLOBAL(zgedmdq,ZGEDMDQ)
|
#define LAPACK_zgedmdq_base LAPACK_GLOBAL(zgedmdq,ZGEDMDQ)
|
||||||
void LAPACK_zgedmdq(
|
void LAPACK_zgedmdq_base(
|
||||||
char const* jobs, char const* jobz, char const* jobr, char const* jobq,
|
char const* jobs, char const* jobz, char const* jobr, char const* jobq,
|
||||||
char const* jobt, char const* jobf, lapack_int const* whtsvd,
|
char const* jobt, char const* jobf, lapack_int const* whtsvd,
|
||||||
lapack_int const* m, lapack_int const* n,
|
lapack_int const* m, lapack_int const* n,
|
||||||
|
@ -3446,14 +3513,25 @@ void LAPACK_zgedmdq(
|
||||||
lapack_complex_double* x, lapack_int const* ldx,
|
lapack_complex_double* x, lapack_int const* ldx,
|
||||||
lapack_complex_double* y, lapack_int const* ldy, lapack_int const* nrnk,
|
lapack_complex_double* y, lapack_int const* ldy, lapack_int const* nrnk,
|
||||||
double const* tol, lapack_int const* k,
|
double const* tol, lapack_int const* k,
|
||||||
lapack_complex_double* reig, lapack_complex_double* imeig,
|
lapack_complex_double* eigs,
|
||||||
lapack_complex_double* z, lapack_int const* ldz, lapack_complex_double* res,
|
lapack_complex_double* z, lapack_int const* ldz, double* res,
|
||||||
lapack_complex_double* b, lapack_int const* ldb,
|
lapack_complex_double* b, lapack_int const* ldb,
|
||||||
lapack_complex_double* v, lapack_int const* ldv,
|
lapack_complex_double* v, lapack_int const* ldv,
|
||||||
lapack_complex_double* s, lapack_int const* lds,
|
lapack_complex_double* s, lapack_int const* lds,
|
||||||
lapack_complex_double* work, lapack_int const* lwork,
|
lapack_complex_double* zwork, lapack_int const* lzwork,
|
||||||
|
double* work, lapack_int const* lwork,
|
||||||
lapack_int* iwork, lapack_int const* liwork,
|
lapack_int* iwork, lapack_int const* liwork,
|
||||||
lapack_int* info );
|
lapack_int* info
|
||||||
|
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
, size_t, size_t, size_t, size_t, size_t, size_t
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
|
#define LAPACK_zgedmdq(...) LAPACK_zgedmdq_base(__VA_ARGS__, 1, 1, 1, 1, 1, 1)
|
||||||
|
#else
|
||||||
|
#define LAPACK_zgedmdq(...) LAPACK_zgedmdq_base(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LAPACK_cgesv LAPACK_GLOBAL(cgesv,CGESV)
|
#define LAPACK_cgesv LAPACK_GLOBAL(cgesv,CGESV)
|
||||||
lapack_int LAPACK_cgesv(
|
lapack_int LAPACK_cgesv(
|
||||||
|
@ -21649,7 +21727,7 @@ void LAPACK_ztrevc_base(
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
#ifdef LAPACK_FORTRAN_STRLEN_END
|
#ifdef LAPACK_FORTRAN_STRLEN_END
|
||||||
#define LAPACK_ztrevc(...) LAPACK_ztrevc_base(__VA_ARGS__, 1, 1)
|
#define LAPACK_ztrevc(...) LAPACK_ztrevc_base(__VA_ARGS__, (size_t)1, 1)
|
||||||
#else
|
#else
|
||||||
#define LAPACK_ztrevc(...) LAPACK_ztrevc_base(__VA_ARGS__)
|
#define LAPACK_ztrevc(...) LAPACK_ztrevc_base(__VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -5713,55 +5713,59 @@ lapack_int LAPACKE_zgesdd_work( int matrix_layout, char jobz, lapack_int m,
|
||||||
double* rwork, lapack_int* iwork );
|
double* rwork, lapack_int* iwork );
|
||||||
|
|
||||||
lapack_int LAPACKE_sgedmd_work( int matrix_layout, char jobs, char jobz,
|
lapack_int LAPACKE_sgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
char jobf, lapack_int whtsvd, lapack_int m,
|
char jobr, char jobf, lapack_int whtsvd,
|
||||||
lapack_int n, float* x, lapack_int ldx,
|
lapack_int m, lapack_int n, float* x,
|
||||||
float* y, lapack_int ldy, lapack_int k,
|
lapack_int ldx, float* y, lapack_int ldy,
|
||||||
float* reig, float* imeig, float* z,
|
lapack_int nrnk, float* tol, lapack_int k,
|
||||||
lapack_int ldz, float* res, float* b,
|
float* reig, float* imeig,
|
||||||
lapack_int ldb, float* w, lapack_int ldw,
|
float* z, lapack_int ldz, float* res,
|
||||||
float* s, lapack_int lds, float* work,
|
float* b, lapack_int ldb, float* w,
|
||||||
lapack_int lwork, lapack_int* iwork,
|
lapack_int ldw, float* s, lapack_int lds,
|
||||||
lapack_int liwork );
|
float* work, lapack_int lwork,
|
||||||
|
lapack_int* iwork, lapack_int liwork );
|
||||||
|
|
||||||
lapack_int LAPACKE_dgedmd_work( int matrix_layout, char jobs, char jobz,
|
lapack_int LAPACKE_dgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
char jobf, lapack_int whtsvd, lapack_int m,
|
char jobr, char jobf, lapack_int whtsvd,
|
||||||
lapack_int n, double* x, lapack_int ldx,
|
lapack_int m, lapack_int n, double* x,
|
||||||
double* y, lapack_int ldy, lapack_int k,
|
lapack_int ldx, double* y, lapack_int ldy,
|
||||||
double* reig, double* imeig, double* z,
|
lapack_int nrnk, double* tol, lapack_int k,
|
||||||
lapack_int ldz, double* res, double* b,
|
double* reig, double *imeig,
|
||||||
lapack_int ldb, double* w, lapack_int ldw,
|
double* z, lapack_int ldz, double* res,
|
||||||
double* s, lapack_int lds, double* work,
|
double* b, lapack_int ldb, double* w,
|
||||||
lapack_int lwork, lapack_int* iwork,
|
lapack_int ldw, double* s, lapack_int lds,
|
||||||
lapack_int liwork );
|
double* work, lapack_int lwork,
|
||||||
|
lapack_int* iwork, lapack_int liwork );
|
||||||
|
|
||||||
lapack_int LAPACKE_cgedmd_work( int matrix_layout, char jobs, char jobz,
|
lapack_int LAPACKE_cgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
char jobf, lapack_int whtsvd, lapack_int m,
|
char jobr, char jobf, lapack_int whtsvd,
|
||||||
lapack_int n, lapack_complex_float* x,
|
lapack_int m, lapack_int n,
|
||||||
lapack_int ldx, lapack_complex_float* y,
|
lapack_complex_float* x, lapack_int ldx,
|
||||||
lapack_int ldy, lapack_int k,
|
lapack_complex_float* y, lapack_int ldy,
|
||||||
lapack_complex_float* reig,
|
lapack_int nrnk, float* tol, lapack_int k,
|
||||||
lapack_complex_float* imeig,
|
lapack_complex_float* eigs,
|
||||||
lapack_complex_float* z, lapack_int ldz,
|
lapack_complex_float* z, lapack_int ldz,
|
||||||
lapack_complex_float* res,
|
float* res,
|
||||||
lapack_complex_float* b, lapack_int ldb,
|
lapack_complex_float* b, lapack_int ldb,
|
||||||
lapack_complex_float* w, lapack_int ldw,
|
lapack_complex_float* w, lapack_int ldw,
|
||||||
lapack_complex_float* s, lapack_int lds,
|
lapack_complex_float* s, lapack_int lds,
|
||||||
lapack_complex_float* work, lapack_int lwork,
|
lapack_complex_float* zwork, lapack_int lzwork,
|
||||||
|
float* work, lapack_int lwork,
|
||||||
lapack_int* iwork, lapack_int liwork );
|
lapack_int* iwork, lapack_int liwork );
|
||||||
|
|
||||||
lapack_int LAPACKE_zgedmd_work( int matrix_layout, char jobs, char jobz,
|
lapack_int LAPACKE_zgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
char jobf, lapack_int whtsvd, lapack_int m,
|
char jobr, char jobf, lapack_int whtsvd,
|
||||||
lapack_int n, lapack_complex_double* x,
|
lapack_int m, lapack_int n,
|
||||||
lapack_int ldx, lapack_complex_double* y,
|
lapack_complex_double* x, lapack_int ldx,
|
||||||
lapack_int ldy, lapack_int k,
|
lapack_complex_double* y, lapack_int ldy,
|
||||||
lapack_complex_double* reig,
|
lapack_int nrnk, double* tol, lapack_int k,
|
||||||
lapack_complex_double* imeig,
|
lapack_complex_double* eigs,
|
||||||
lapack_complex_double* z, lapack_int ldz,
|
lapack_complex_double* z, lapack_int ldz,
|
||||||
lapack_complex_double* res,
|
double* res,
|
||||||
lapack_complex_double* b, lapack_int ldb,
|
lapack_complex_double* b, lapack_int ldb,
|
||||||
lapack_complex_double* w, lapack_int ldw,
|
lapack_complex_double* w, lapack_int ldw,
|
||||||
lapack_complex_double* s, lapack_int lds,
|
lapack_complex_double* s, lapack_int lds,
|
||||||
lapack_complex_double* work, lapack_int lwork,
|
lapack_complex_double* zwork, lapack_int lzwork,
|
||||||
|
double* work, lapack_int lwork,
|
||||||
lapack_int* iwork, lapack_int liwork );
|
lapack_int* iwork, lapack_int liwork );
|
||||||
|
|
||||||
lapack_int LAPACKE_sgedmdq_work( int matrix_layout, char jobs, char jobz,
|
lapack_int LAPACKE_sgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
|
@ -5769,8 +5773,8 @@ lapack_int LAPACKE_sgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
lapack_int whtsvd, lapack_int m, lapack_int n,
|
lapack_int whtsvd, lapack_int m, lapack_int n,
|
||||||
float* f, lapack_int ldf, float* x,
|
float* f, lapack_int ldf, float* x,
|
||||||
lapack_int ldx, float* y, lapack_int ldy,
|
lapack_int ldx, float* y, lapack_int ldy,
|
||||||
lapack_int nrnk, float tol, lapack_int k,
|
lapack_int nrnk, float* tol, lapack_int k,
|
||||||
float* reig, float* imeig, float* z,
|
float* reig, float *imeig, float* z,
|
||||||
lapack_int ldz, float* res, float* b,
|
lapack_int ldz, float* res, float* b,
|
||||||
lapack_int ldb, float* v, lapack_int ldv,
|
lapack_int ldb, float* v, lapack_int ldv,
|
||||||
float* s, lapack_int lds, float* work,
|
float* s, lapack_int lds, float* work,
|
||||||
|
@ -5782,7 +5786,7 @@ lapack_int LAPACKE_dgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
lapack_int whtsvd, lapack_int m, lapack_int n,
|
lapack_int whtsvd, lapack_int m, lapack_int n,
|
||||||
double* f, lapack_int ldf, double* x,
|
double* f, lapack_int ldf, double* x,
|
||||||
lapack_int ldx, double* y, lapack_int ldy,
|
lapack_int ldx, double* y, lapack_int ldy,
|
||||||
lapack_int nrnk, double tol, lapack_int k,
|
lapack_int nrnk, double* tol, lapack_int k,
|
||||||
double* reig, double* imeig, double* z,
|
double* reig, double* imeig, double* z,
|
||||||
lapack_int ldz, double* res, double* b,
|
lapack_int ldz, double* res, double* b,
|
||||||
lapack_int ldb, double* v, lapack_int ldv,
|
lapack_int ldb, double* v, lapack_int ldv,
|
||||||
|
@ -5796,17 +5800,16 @@ lapack_int LAPACKE_cgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
lapack_complex_float* f, lapack_int ldf,
|
lapack_complex_float* f, lapack_int ldf,
|
||||||
lapack_complex_float* x, lapack_int ldx,
|
lapack_complex_float* x, lapack_int ldx,
|
||||||
lapack_complex_float* y, lapack_int ldy,
|
lapack_complex_float* y, lapack_int ldy,
|
||||||
lapack_int nrnk, float tol, lapack_int k,
|
lapack_int nrnk, float* tol, lapack_int k,
|
||||||
lapack_complex_float* reig,
|
lapack_complex_float* eigs,
|
||||||
lapack_complex_float* imeig,
|
|
||||||
lapack_complex_float* z, lapack_int ldz,
|
lapack_complex_float* z, lapack_int ldz,
|
||||||
lapack_complex_float* res,
|
float* res,
|
||||||
lapack_complex_float* b, lapack_int ldb,
|
lapack_complex_float* b, lapack_int ldb,
|
||||||
lapack_complex_float* v, lapack_int ldv,
|
lapack_complex_float* v, lapack_int ldv,
|
||||||
lapack_complex_float* s, lapack_int lds,
|
lapack_complex_float* s, lapack_int lds,
|
||||||
lapack_complex_float* work, lapack_int lwork,
|
lapack_complex_float* zwork, lapack_int lzwork,
|
||||||
lapack_int* iwork,
|
float* work, lapack_int lwork,
|
||||||
lapack_int liwork );
|
lapack_int* iwork, lapack_int liwork);
|
||||||
|
|
||||||
lapack_int LAPACKE_zgedmdq_work( int matrix_layout, char jobs, char jobz,
|
lapack_int LAPACKE_zgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
char jobr, char jobq, char jobt, char jobf,
|
char jobr, char jobq, char jobt, char jobf,
|
||||||
|
@ -5814,17 +5817,16 @@ lapack_int LAPACKE_zgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
lapack_complex_double* f, lapack_int ldf,
|
lapack_complex_double* f, lapack_int ldf,
|
||||||
lapack_complex_double* x, lapack_int ldx,
|
lapack_complex_double* x, lapack_int ldx,
|
||||||
lapack_complex_double* y, lapack_int ldy,
|
lapack_complex_double* y, lapack_int ldy,
|
||||||
lapack_int nrnk, double tol, lapack_int k,
|
lapack_int nrnk, double* tol, lapack_int k,
|
||||||
lapack_complex_double* reig,
|
lapack_complex_double* eigs,
|
||||||
lapack_complex_double* imeig,
|
|
||||||
lapack_complex_double* z, lapack_int ldz,
|
lapack_complex_double* z, lapack_int ldz,
|
||||||
lapack_complex_double* res,
|
double* res,
|
||||||
lapack_complex_double* b, lapack_int ldb,
|
lapack_complex_double* b, lapack_int ldb,
|
||||||
lapack_complex_double* v, lapack_int ldv,
|
lapack_complex_double* v, lapack_int ldv,
|
||||||
lapack_complex_double* s, lapack_int lds,
|
lapack_complex_double* s, lapack_int lds,
|
||||||
lapack_complex_double* work, lapack_int lwork,
|
lapack_complex_double* zwork, lapack_int lzwork,
|
||||||
lapack_int* iwork,
|
double* work, lapack_int lwork,
|
||||||
lapack_int liwork );
|
lapack_int* iwork, lapack_int liwork);
|
||||||
|
|
||||||
lapack_int LAPACKE_sgesv_work( int matrix_layout, lapack_int n, lapack_int nrhs,
|
lapack_int LAPACKE_sgesv_work( int matrix_layout, lapack_int n, lapack_int nrhs,
|
||||||
float* a, lapack_int lda, lapack_int* ipiv,
|
float* a, lapack_int lda, lapack_int* ipiv,
|
||||||
|
|
|
@ -32,22 +32,26 @@
|
||||||
|
|
||||||
#include "lapacke_utils.h"
|
#include "lapacke_utils.h"
|
||||||
|
|
||||||
lapack_int LAPACKE_cgedmd( int matrix_layout, char jobs, char jobz, char jobf,
|
lapack_int LAPACKE_cgedmd( int matrix_layout, char jobs, char jobz, char jobr,
|
||||||
lapack_int whtsvd, lapack_int m, lapack_int n,
|
char jobf, lapack_int whtsvd, lapack_int m,
|
||||||
lapack_complex_float* x, lapack_int ldx,
|
lapack_int n, lapack_complex_float* x,
|
||||||
lapack_complex_float* y, lapack_int ldy, lapack_int k,
|
lapack_int ldx, lapack_complex_float* y,
|
||||||
lapack_complex_float* reig, lapack_complex_float* imeig,
|
lapack_int ldy, lapack_int nrnk, float* tol,
|
||||||
|
lapack_int k, lapack_complex_float* eigs,
|
||||||
lapack_complex_float* z, lapack_int ldz,
|
lapack_complex_float* z, lapack_int ldz,
|
||||||
lapack_complex_float* res, lapack_complex_float* b,
|
float* res, lapack_complex_float* b,
|
||||||
lapack_int ldb, lapack_complex_float* w,
|
lapack_int ldb, lapack_complex_float* w,
|
||||||
lapack_int ldw, lapack_complex_float* s, lapack_int lds)
|
lapack_int ldw, lapack_complex_float* s, lapack_int lds)
|
||||||
{
|
{
|
||||||
lapack_int info = 0;
|
lapack_int info = 0;
|
||||||
lapack_int lwork = -1;
|
lapack_int lwork = -1;
|
||||||
lapack_int liwork = -1;
|
lapack_int liwork = -1;
|
||||||
lapack_complex_float* work = NULL;
|
lapack_int lzwork = -1;
|
||||||
|
lapack_complex_float* zwork = NULL;
|
||||||
|
float* work = NULL;
|
||||||
lapack_int* iwork = NULL;
|
lapack_int* iwork = NULL;
|
||||||
lapack_complex_float work_query;
|
lapack_complex_float zwork_query;
|
||||||
|
float work_query;
|
||||||
lapack_int iwork_query;
|
lapack_int iwork_query;
|
||||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||||
LAPACKE_xerbla( "LAPACKE_cgedmd", -1 );
|
LAPACKE_xerbla( "LAPACKE_cgedmd", -1 );
|
||||||
|
@ -77,36 +81,44 @@ lapack_int LAPACKE_cgedmd( int matrix_layout, char jobs, char jobz, char jobf,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Query optimal working array(s) size */
|
/* Query optimal working array(s) size */
|
||||||
info = LAPACKE_cgedmd_work( matrix_layout, jobs, jobz, jobf, whtsvd, m, n,
|
info = LAPACKE_cgedmd_work( matrix_layout, jobs, jobz, jobr, jobf, whtsvd,
|
||||||
x, ldx, y, ldy, k, reig, imeig, z, ldz, res,
|
m, n, x, ldx, y, ldy, nrnk, tol, k, eigs, z, ldz,
|
||||||
b, ldb, w, ldw, s, lds, &work_query, lwork,
|
res, b, ldb, w, ldw, s, lds, &zwork_query,
|
||||||
&iwork_query, liwork );
|
lzwork, &work_query, lwork, &iwork_query, liwork );
|
||||||
|
|
||||||
if( info != 0 ) {
|
if( info != 0 ) {
|
||||||
goto exit_level_0;
|
goto exit_level_0;
|
||||||
}
|
}
|
||||||
|
lzwork = LAPACK_C2INT( zwork_query );
|
||||||
lwork = LAPACK_C2INT( work_query );
|
lwork = LAPACK_C2INT( work_query );
|
||||||
liwork = iwork_query;
|
liwork = iwork_query;
|
||||||
/* Allocate memory for work arrays */
|
/* Allocate memory for work arrays */
|
||||||
work = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
zwork = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lzwork );
|
||||||
if( work == NULL ) {
|
if( zwork == NULL ) {
|
||||||
info = LAPACK_WORK_MEMORY_ERROR;
|
info = LAPACK_WORK_MEMORY_ERROR;
|
||||||
goto exit_level_0;
|
goto exit_level_0;
|
||||||
}
|
}
|
||||||
|
work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
|
||||||
|
if( work == NULL ) {
|
||||||
|
info = LAPACK_WORK_MEMORY_ERROR;
|
||||||
|
goto exit_level_1;
|
||||||
|
}
|
||||||
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
|
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
|
||||||
if( iwork == NULL ) {
|
if( iwork == NULL ) {
|
||||||
info = LAPACK_WORK_MEMORY_ERROR;
|
info = LAPACK_WORK_MEMORY_ERROR;
|
||||||
goto exit_level_1;
|
goto exit_level_2;
|
||||||
}
|
}
|
||||||
/* Call middle-level interface */
|
/* Call middle-level interface */
|
||||||
info = LAPACKE_cgedmd_work( matrix_layout, jobs, jobz, jobf, whtsvd, m, n,
|
info = LAPACKE_cgedmd_work( matrix_layout, jobs, jobz, jobr, jobf, whtsvd,
|
||||||
x, ldx, y, ldy, k, reig, imeig, z, ldz, res,
|
m, n, x, ldx, y, ldy, nrnk, tol, k, eigs, z, ldz,
|
||||||
b, ldb, w, ldw, s, lds, work, lwork, iwork,
|
res, b, ldb, w, ldw, s, lds, zwork, lzwork,
|
||||||
liwork );
|
work, lwork, iwork, liwork );
|
||||||
/* Release memory and exit */
|
/* Release memory and exit */
|
||||||
LAPACKE_free( iwork );
|
LAPACKE_free( iwork );
|
||||||
exit_level_1:
|
exit_level_2:
|
||||||
LAPACKE_free( work );
|
LAPACKE_free( work );
|
||||||
|
exit_level_1:
|
||||||
|
LAPACKE_free( zwork );
|
||||||
exit_level_0:
|
exit_level_0:
|
||||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||||
LAPACKE_xerbla( "LAPACKE_cgedmd", info );
|
LAPACKE_xerbla( "LAPACKE_cgedmd", info );
|
||||||
|
|
|
@ -33,23 +33,25 @@
|
||||||
#include "lapacke_utils.h"
|
#include "lapacke_utils.h"
|
||||||
|
|
||||||
lapack_int LAPACKE_cgedmd_work( int matrix_layout, char jobs, char jobz,
|
lapack_int LAPACKE_cgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
char jobf, lapack_int whtsvd, lapack_int m,
|
char jobr, char jobf, lapack_int whtsvd, lapack_int m,
|
||||||
lapack_int n, lapack_complex_float* x, lapack_int ldx,
|
lapack_int n, lapack_complex_float* x, lapack_int ldx,
|
||||||
lapack_complex_float* y, lapack_int ldy, lapack_int k,
|
lapack_complex_float* y, lapack_int ldy, lapack_int nrnk,
|
||||||
lapack_complex_float* reig, lapack_complex_float* imeig,
|
float* tol, lapack_int k, lapack_complex_float* eigs,
|
||||||
lapack_complex_float* z, lapack_int ldz,
|
lapack_complex_float* z, lapack_int ldz,
|
||||||
lapack_complex_float* res, lapack_complex_float* b,
|
float* res, lapack_complex_float* b,
|
||||||
lapack_int ldb, lapack_complex_float* w,
|
lapack_int ldb, lapack_complex_float* w,
|
||||||
lapack_int ldw, lapack_complex_float* s, lapack_int lds,
|
lapack_int ldw, lapack_complex_float* s, lapack_int lds,
|
||||||
lapack_complex_float* work, lapack_int lwork,
|
lapack_complex_float* zwork, lapack_int lzwork,
|
||||||
|
float* work, lapack_int lwork,
|
||||||
lapack_int* iwork, lapack_int liwork )
|
lapack_int* iwork, lapack_int liwork )
|
||||||
{
|
{
|
||||||
lapack_int info = 0;
|
lapack_int info = 0;
|
||||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_cgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x, &ldx, y, &ldy,
|
LAPACK_cgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x, &ldx, y,
|
||||||
&k, reig, imeig, z, &ldz, res, b, &ldb, w, &ldw, s, &lds,
|
&ldy, &nrnk, tol, &k, eigs, z, &ldz, res, b, &ldb, w, &ldw,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
s, &lds, zwork, &lzwork, work, &lwork, iwork, &liwork,
|
||||||
|
&info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
}
|
}
|
||||||
|
@ -99,8 +101,9 @@ lapack_int LAPACKE_cgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
}
|
}
|
||||||
/* Query optimal working array(s) size if requested */
|
/* Query optimal working array(s) size if requested */
|
||||||
if( lwork == -1 ) {
|
if( lwork == -1 ) {
|
||||||
LAPACK_cgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x, &ldx, y, &ldy,
|
LAPACK_cgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x,
|
||||||
&k, reig, imeig, z, &ldz, res, b, &ldb, w, &ldw, s, &lds,
|
&ldx, y, &ldy, &nrnk, tol, &k, eigs, z, &ldz, res, b,
|
||||||
|
&ldb, w, &ldw, s, &lds, zwork, &lzwork,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
work, &lwork, iwork, &liwork, &info );
|
||||||
return (info < 0) ? (info - 1) : info;
|
return (info < 0) ? (info - 1) : info;
|
||||||
}
|
}
|
||||||
|
@ -143,9 +146,10 @@ lapack_int LAPACKE_cgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
LAPACKE_cge_trans( matrix_layout, m, n, w, ldw, w_t, ldw_t );
|
LAPACKE_cge_trans( matrix_layout, m, n, w, ldw, w_t, ldw_t );
|
||||||
LAPACKE_cge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
LAPACKE_cge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_cgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x_t, &ldx_t, y_t,
|
LAPACK_cgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x_t,
|
||||||
&ldy_t, &k, reig, imeig, z_t, &ldz_t, res, b_t, &ldb_t,
|
&ldx_t, y_t, &ldy_t, &nrnk, tol, &k, eigs, z_t, &ldz_t,
|
||||||
w_t, &ldw_t, s_t, &lds_t, work, &lwork, iwork, &liwork, &info );
|
res, b_t, &ldb_t, w_t, &ldw_t, s_t, &lds_t, zwork,
|
||||||
|
&lzwork, work, &lwork, iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,20 +37,22 @@ lapack_int LAPACKE_cgedmdq( int matrix_layout, char jobs, char jobz, char jobr,
|
||||||
lapack_int m, lapack_int n, lapack_complex_float* f,
|
lapack_int m, lapack_int n, lapack_complex_float* f,
|
||||||
lapack_int ldf, lapack_complex_float* x,
|
lapack_int ldf, lapack_complex_float* x,
|
||||||
lapack_int ldx, lapack_complex_float* y,
|
lapack_int ldx, lapack_complex_float* y,
|
||||||
lapack_int ldy, lapack_int nrnk, float tol,
|
lapack_int ldy, lapack_int nrnk, float* tol,
|
||||||
lapack_int k, lapack_complex_float* reig,
|
lapack_int k, lapack_complex_float* eigs,
|
||||||
lapack_complex_float* imeig,
|
|
||||||
lapack_complex_float* z, lapack_int ldz,
|
lapack_complex_float* z, lapack_int ldz,
|
||||||
lapack_complex_float* res, lapack_complex_float* b,
|
float* res, lapack_complex_float* b,
|
||||||
lapack_int ldb, lapack_complex_float* v,
|
lapack_int ldb, lapack_complex_float* v,
|
||||||
lapack_int ldv, lapack_complex_float* s, lapack_int lds)
|
lapack_int ldv, lapack_complex_float* s, lapack_int lds)
|
||||||
{
|
{
|
||||||
lapack_int info = 0;
|
lapack_int info = 0;
|
||||||
lapack_int lwork = -1;
|
lapack_int lwork = -1;
|
||||||
lapack_int liwork = -1;
|
lapack_int liwork = -1;
|
||||||
lapack_complex_float* work = NULL;
|
lapack_int lzwork = -1;
|
||||||
|
lapack_complex_float* zwork = NULL;
|
||||||
|
float* work = NULL;
|
||||||
lapack_int* iwork = NULL;
|
lapack_int* iwork = NULL;
|
||||||
lapack_complex_float work_query;
|
lapack_complex_float zwork_query;
|
||||||
|
float work_query;
|
||||||
lapack_int iwork_query;
|
lapack_int iwork_query;
|
||||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||||
LAPACKE_xerbla( "LAPACKE_cgedmdq", -1 );
|
LAPACKE_xerbla( "LAPACKE_cgedmdq", -1 );
|
||||||
|
@ -85,36 +87,44 @@ lapack_int LAPACKE_cgedmdq( int matrix_layout, char jobs, char jobz, char jobr,
|
||||||
/* Query optimal working array(s) size */
|
/* Query optimal working array(s) size */
|
||||||
info = LAPACKE_cgedmdq_work( matrix_layout, jobs, jobz, jobr, jobq, jobt,
|
info = LAPACKE_cgedmdq_work( matrix_layout, jobs, jobz, jobr, jobq, jobt,
|
||||||
jobf, whtsvd, m, n, f, ldf, x, ldx, y, ldy,
|
jobf, whtsvd, m, n, f, ldf, x, ldx, y, ldy,
|
||||||
nrnk, tol, k, reig, imeig, z, ldz, res,
|
nrnk, tol, k, eigs, z, ldz, res,
|
||||||
b, ldb, v, ldv, s, lds, &work_query, lwork,
|
b, ldb, v, ldv, s, lds, &zwork_query, lzwork,
|
||||||
&iwork_query, liwork );
|
&work_query, lwork, &iwork_query, liwork );
|
||||||
|
|
||||||
if( info != 0 ) {
|
if( info != 0 ) {
|
||||||
goto exit_level_0;
|
goto exit_level_0;
|
||||||
}
|
}
|
||||||
|
lzwork = LAPACK_C2INT( zwork_query );
|
||||||
lwork = LAPACK_C2INT( work_query );
|
lwork = LAPACK_C2INT( work_query );
|
||||||
liwork = iwork_query;
|
liwork = iwork_query;
|
||||||
/* Allocate memory for work arrays */
|
/* Allocate memory for work arrays */
|
||||||
work = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
zwork = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lzwork );
|
||||||
if( work == NULL ) {
|
if( zwork == NULL ) {
|
||||||
info = LAPACK_WORK_MEMORY_ERROR;
|
info = LAPACK_WORK_MEMORY_ERROR;
|
||||||
goto exit_level_0;
|
goto exit_level_0;
|
||||||
}
|
}
|
||||||
|
work = (float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||||
|
if( work == NULL ) {
|
||||||
|
info = LAPACK_WORK_MEMORY_ERROR;
|
||||||
|
goto exit_level_1;
|
||||||
|
}
|
||||||
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
|
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
|
||||||
if( iwork == NULL ) {
|
if( iwork == NULL ) {
|
||||||
info = LAPACK_WORK_MEMORY_ERROR;
|
info = LAPACK_WORK_MEMORY_ERROR;
|
||||||
goto exit_level_1;
|
goto exit_level_2;
|
||||||
}
|
}
|
||||||
/* Call middle-level interface */
|
/* Call middle-level interface */
|
||||||
info = LAPACKE_cgedmdq_work( matrix_layout, jobs, jobz, jobr, jobq, jobt,
|
info = LAPACKE_cgedmdq_work( matrix_layout, jobs, jobz, jobr, jobq, jobt,
|
||||||
jobf, whtsvd, m, n, f, ldf, x, ldx, y, ldy,
|
jobf, whtsvd, m, n, f, ldf, x, ldx, y, ldy,
|
||||||
nrnk, tol, k, reig, imeig, z, ldz, res,
|
nrnk, tol, k, eigs, z, ldz, res,
|
||||||
b, ldb, v, ldv, s, lds, work, lwork, iwork,
|
b, ldb, v, ldv, s, lds, zwork, lzwork,
|
||||||
liwork );
|
work, lwork, iwork, liwork );
|
||||||
/* Release memory and exit */
|
/* Release memory and exit */
|
||||||
LAPACKE_free( iwork );
|
LAPACKE_free( iwork );
|
||||||
exit_level_1:
|
exit_level_2:
|
||||||
LAPACKE_free( work );
|
LAPACKE_free( work );
|
||||||
|
exit_level_1:
|
||||||
|
LAPACKE_free( zwork );
|
||||||
exit_level_0:
|
exit_level_0:
|
||||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||||
LAPACKE_xerbla( "LAPACKE_cgedmdq", info );
|
LAPACKE_xerbla( "LAPACKE_cgedmdq", info );
|
||||||
|
|
|
@ -38,15 +38,15 @@ lapack_int LAPACKE_cgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
lapack_complex_float* f, lapack_int ldf,
|
lapack_complex_float* f, lapack_int ldf,
|
||||||
lapack_complex_float* x, lapack_int ldx,
|
lapack_complex_float* x, lapack_int ldx,
|
||||||
lapack_complex_float* y, lapack_int ldy,
|
lapack_complex_float* y, lapack_int ldy,
|
||||||
lapack_int nrnk, float tol, lapack_int k,
|
lapack_int nrnk, float* tol, lapack_int k,
|
||||||
lapack_complex_float* reig,
|
lapack_complex_float* eigs,
|
||||||
lapack_complex_float* imeig,
|
|
||||||
lapack_complex_float* z,
|
lapack_complex_float* z,
|
||||||
lapack_int ldz, lapack_complex_float* res,
|
lapack_int ldz, float* res,
|
||||||
lapack_complex_float* b,
|
lapack_complex_float* b,
|
||||||
lapack_int ldb, lapack_complex_float* v,
|
lapack_int ldb, lapack_complex_float* v,
|
||||||
lapack_int ldv, lapack_complex_float* s,
|
lapack_int ldv, lapack_complex_float* s,
|
||||||
lapack_int lds, lapack_complex_float* work,
|
lapack_int lds, lapack_complex_float *zwork,
|
||||||
|
lapack_int lzwork, float* work,
|
||||||
lapack_int lwork, lapack_int* iwork,
|
lapack_int lwork, lapack_int* iwork,
|
||||||
lapack_int liwork )
|
lapack_int liwork )
|
||||||
{
|
{
|
||||||
|
@ -54,9 +54,9 @@ lapack_int LAPACKE_cgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_cgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
LAPACK_cgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
||||||
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
|
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, eigs,
|
||||||
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
zwork, &lzwork, work, &lwork, iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
}
|
}
|
||||||
|
@ -112,11 +112,11 @@ lapack_int LAPACKE_cgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
/* Query optimal working array(s) size if requested */
|
/* Query optimal working array(s) size if requested */
|
||||||
if( lwork == -1 || liwork == -1 ) {
|
if( lzwork == -1 || lwork == -1 || liwork == -1 ) {
|
||||||
LAPACK_cgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
LAPACK_cgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
||||||
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
|
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, eigs,
|
||||||
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
zwork, &lzwork, work, &lwork, iwork, &liwork, &info );
|
||||||
return (info < 0) ? (info - 1) : info;
|
return (info < 0) ? (info - 1) : info;
|
||||||
}
|
}
|
||||||
/* Allocate memory for temporary array(s) */
|
/* Allocate memory for temporary array(s) */
|
||||||
|
@ -165,9 +165,9 @@ lapack_int LAPACKE_cgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
LAPACKE_cge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
LAPACKE_cge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_cgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
LAPACK_cgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
||||||
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
|
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, eigs,
|
||||||
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
zwork, &lzwork, work, &lwork, iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,11 +32,13 @@
|
||||||
|
|
||||||
#include "lapacke_utils.h"
|
#include "lapacke_utils.h"
|
||||||
|
|
||||||
lapack_int LAPACKE_dgedmd( int matrix_layout, char jobs, char jobz, char jobf,
|
lapack_int LAPACKE_dgedmd( int matrix_layout, char jobs, char jobz, char jobr,
|
||||||
lapack_int whtsvd, lapack_int m, lapack_int n,
|
char jobf, lapack_int whtsvd, lapack_int m,
|
||||||
double* x, lapack_int ldx, double* y, lapack_int ldy,
|
lapack_int n, double* x, lapack_int ldx, double* y,
|
||||||
lapack_int k, double* reig, double* imeig, double* z,
|
lapack_int ldy, lapack_int nrnk, double* tol,
|
||||||
lapack_int ldz, double* res, double* b, lapack_int ldb,
|
lapack_int k, double* reig, double* imeig,
|
||||||
|
double* z, lapack_int ldz,
|
||||||
|
double* res, double* b, lapack_int ldb,
|
||||||
double* w, lapack_int ldw, double* s, lapack_int lds)
|
double* w, lapack_int ldw, double* s, lapack_int lds)
|
||||||
{
|
{
|
||||||
lapack_int info = 0;
|
lapack_int info = 0;
|
||||||
|
@ -74,10 +76,10 @@ lapack_int LAPACKE_dgedmd( int matrix_layout, char jobs, char jobz, char jobf,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Query optimal working array(s) size */
|
/* Query optimal working array(s) size */
|
||||||
info = LAPACKE_dgedmd_work( matrix_layout, jobs, jobz, jobf, whtsvd, m, n,
|
info = LAPACKE_dgedmd_work( matrix_layout, jobs, jobz, jobr, jobf, whtsvd,
|
||||||
x, ldx, y, ldy, k, reig, imeig, z, ldz, res,
|
m, n, x, ldx, y, ldy, nrnk, tol, k, reig, imeig, z, ldz,
|
||||||
b, ldb, w, ldw, s, lds, &work_query, lwork,
|
res, b, ldb, w, ldw, s, lds, &work_query,
|
||||||
&iwork_query, liwork );
|
lwork, &iwork_query, liwork );
|
||||||
|
|
||||||
if( info != 0 ) {
|
if( info != 0 ) {
|
||||||
goto exit_level_0;
|
goto exit_level_0;
|
||||||
|
@ -96,10 +98,10 @@ lapack_int LAPACKE_dgedmd( int matrix_layout, char jobs, char jobz, char jobf,
|
||||||
goto exit_level_1;
|
goto exit_level_1;
|
||||||
}
|
}
|
||||||
/* Call middle-level interface */
|
/* Call middle-level interface */
|
||||||
info = LAPACKE_dgedmd_work( matrix_layout, jobs, jobz, jobf, whtsvd, m, n,
|
info = LAPACKE_dgedmd_work( matrix_layout, jobs, jobz, jobr, jobf, whtsvd,
|
||||||
x, ldx, y, ldy, k, reig, imeig, z, ldz, res,
|
m, n, x, ldx, y, ldy, nrnk, tol, k, reig, imeig, z, ldz,
|
||||||
b, ldb, w, ldw, s, lds, work, lwork, iwork,
|
res, b, ldb, w, ldw, s, lds, work, lwork,
|
||||||
liwork );
|
iwork, liwork );
|
||||||
/* Release memory and exit */
|
/* Release memory and exit */
|
||||||
LAPACKE_free( iwork );
|
LAPACKE_free( iwork );
|
||||||
exit_level_1:
|
exit_level_1:
|
||||||
|
|
|
@ -33,22 +33,23 @@
|
||||||
#include "lapacke_utils.h"
|
#include "lapacke_utils.h"
|
||||||
|
|
||||||
lapack_int LAPACKE_dgedmd_work( int matrix_layout, char jobs, char jobz,
|
lapack_int LAPACKE_dgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
char jobf, lapack_int whtsvd, lapack_int m,
|
char jobr, char jobf, lapack_int whtsvd,
|
||||||
lapack_int n, double* x, lapack_int ldx,
|
lapack_int m, lapack_int n, double* x,
|
||||||
double* y, lapack_int ldy, lapack_int k,
|
lapack_int ldx, double* y, lapack_int ldy,
|
||||||
double* reig, double* imeig, double* z,
|
lapack_int nrnk, double* tol, lapack_int k,
|
||||||
lapack_int ldz, double* res, double* b,
|
double* reig, double* imeig,
|
||||||
lapack_int ldb, double* w, lapack_int ldw,
|
double* z, lapack_int ldz, double* res,
|
||||||
double* s, lapack_int lds, double* work,
|
double* b, lapack_int ldb, double* w,
|
||||||
lapack_int lwork, lapack_int* iwork,
|
lapack_int ldw, double* s, lapack_int lds,
|
||||||
lapack_int liwork )
|
double* work, lapack_int lwork,
|
||||||
|
lapack_int* iwork, lapack_int liwork )
|
||||||
{
|
{
|
||||||
lapack_int info = 0;
|
lapack_int info = 0;
|
||||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_dgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x, &ldx, y, &ldy,
|
LAPACK_dgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x, &ldx, y,
|
||||||
&k, reig, imeig, z, &ldz, res, b, &ldb, w, &ldw, s, &lds,
|
&ldy, &nrnk, tol, &k, reig, imeig, z, &ldz, res, b, &ldb, w, &ldw,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
s, &lds, work, &lwork, iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
}
|
}
|
||||||
|
@ -98,9 +99,9 @@ lapack_int LAPACKE_dgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
}
|
}
|
||||||
/* Query optimal working array(s) size if requested */
|
/* Query optimal working array(s) size if requested */
|
||||||
if( lwork == -1 ) {
|
if( lwork == -1 ) {
|
||||||
LAPACK_dgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x, &ldx, y, &ldy,
|
LAPACK_dgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x, &ldx,
|
||||||
&k, reig, imeig, z, &ldz, res, b, &ldb, w, &ldw, s, &lds,
|
y, &ldy, &nrnk, tol, &k, reig, imeig, z, &ldz, res, b, &ldb, w,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
&ldw, s, &lds, work, &lwork, iwork, &liwork, &info );
|
||||||
return (info < 0) ? (info - 1) : info;
|
return (info < 0) ? (info - 1) : info;
|
||||||
}
|
}
|
||||||
/* Allocate memory for temporary array(s) */
|
/* Allocate memory for temporary array(s) */
|
||||||
|
@ -142,9 +143,10 @@ lapack_int LAPACKE_dgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
LAPACKE_dge_trans( matrix_layout, m, n, w, ldw, w_t, ldw_t );
|
LAPACKE_dge_trans( matrix_layout, m, n, w, ldw, w_t, ldw_t );
|
||||||
LAPACKE_dge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
LAPACKE_dge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_dgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x_t, &ldx_t, y_t,
|
LAPACK_dgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x_t, &ldx_t,
|
||||||
&ldy_t, &k, reig, imeig, z_t, &ldz_t, res, b_t, &ldb_t,
|
y_t, &ldy_t, &nrnk, tol, &k, reig, imeig, z_t, &ldz_t, res, b_t,
|
||||||
w_t, &ldw_t, s_t, &lds_t, work, &lwork, iwork, &liwork, &info );
|
&ldb_t, w_t, &ldw_t, s_t, &lds_t, work, &lwork,
|
||||||
|
iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ lapack_int LAPACKE_dgedmdq( int matrix_layout, char jobs, char jobz, char jobr,
|
||||||
char jobq, char jobt, char jobf, lapack_int whtsvd,
|
char jobq, char jobt, char jobf, lapack_int whtsvd,
|
||||||
lapack_int m, lapack_int n, double* f, lapack_int ldf,
|
lapack_int m, lapack_int n, double* f, lapack_int ldf,
|
||||||
double* x, lapack_int ldx, double* y, lapack_int ldy,
|
double* x, lapack_int ldx, double* y, lapack_int ldy,
|
||||||
lapack_int nrnk, double tol, lapack_int k,
|
lapack_int nrnk, double* tol, lapack_int k,
|
||||||
double* reig, double* imeig, double* z,
|
double* reig, double* imeig, double* z,
|
||||||
lapack_int ldz, double* res, double* b, lapack_int ldb,
|
lapack_int ldz, double* res, double* b, lapack_int ldb,
|
||||||
double* v, lapack_int ldv, double* s, lapack_int lds)
|
double* v, lapack_int ldv, double* s, lapack_int lds)
|
||||||
|
|
|
@ -37,7 +37,7 @@ lapack_int LAPACKE_dgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
lapack_int whtsvd, lapack_int m, lapack_int n,
|
lapack_int whtsvd, lapack_int m, lapack_int n,
|
||||||
double* f, lapack_int ldf, double* x,
|
double* f, lapack_int ldf, double* x,
|
||||||
lapack_int ldx, double* y, lapack_int ldy,
|
lapack_int ldx, double* y, lapack_int ldy,
|
||||||
lapack_int nrnk, double tol, lapack_int k,
|
lapack_int nrnk, double* tol, lapack_int k,
|
||||||
double* reig, double* imeig, double* z,
|
double* reig, double* imeig, double* z,
|
||||||
lapack_int ldz, double* res, double* b,
|
lapack_int ldz, double* res, double* b,
|
||||||
lapack_int ldb, double* v, lapack_int ldv,
|
lapack_int ldb, double* v, lapack_int ldv,
|
||||||
|
@ -49,8 +49,8 @@ lapack_int LAPACKE_dgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_dgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
LAPACK_dgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
||||||
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
|
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, reig, imeig,
|
||||||
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
work, &lwork, iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
|
@ -109,8 +109,8 @@ lapack_int LAPACKE_dgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
/* Query optimal working array(s) size if requested */
|
/* Query optimal working array(s) size if requested */
|
||||||
if( lwork == -1 || liwork == -1 ) {
|
if( lwork == -1 || liwork == -1 ) {
|
||||||
LAPACK_dgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
LAPACK_dgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
||||||
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
|
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, reig, imeig,
|
||||||
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
work, &lwork, iwork, &liwork, &info );
|
||||||
return (info < 0) ? (info - 1) : info;
|
return (info < 0) ? (info - 1) : info;
|
||||||
}
|
}
|
||||||
|
@ -160,8 +160,8 @@ lapack_int LAPACKE_dgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
LAPACKE_dge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
LAPACKE_dge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_dgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
LAPACK_dgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
||||||
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
|
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, reig, imeig,
|
||||||
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
work, &lwork, iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
|
|
|
@ -32,12 +32,14 @@
|
||||||
|
|
||||||
#include "lapacke_utils.h"
|
#include "lapacke_utils.h"
|
||||||
|
|
||||||
lapack_int LAPACKE_sgedmd( int matrix_layout, char jobs, char jobz, char jobf,
|
lapack_int LAPACKE_sgedmd( int matrix_layout, char jobs, char jobz, char jobr,
|
||||||
lapack_int whtsvd, lapack_int m, lapack_int n,
|
char jobf, lapack_int whtsvd, lapack_int m,
|
||||||
float* x, lapack_int ldx, float* y, lapack_int ldy,
|
lapack_int n, float* x, lapack_int ldx, float* y,
|
||||||
lapack_int k, float* reig, float* imeig, float* z,
|
lapack_int ldy, lapack_int nrnk, float* tol,
|
||||||
lapack_int ldz, float* res, float* b, lapack_int ldb,
|
lapack_int k, float* reig, float* imeig,
|
||||||
float* w, lapack_int ldw, float* s, lapack_int lds)
|
float* z, lapack_int ldz, float* res,
|
||||||
|
float* b, lapack_int ldb, float* w, lapack_int ldw,
|
||||||
|
float* s, lapack_int lds)
|
||||||
{
|
{
|
||||||
lapack_int info = 0;
|
lapack_int info = 0;
|
||||||
lapack_int lwork = -1;
|
lapack_int lwork = -1;
|
||||||
|
@ -74,10 +76,10 @@ lapack_int LAPACKE_sgedmd( int matrix_layout, char jobs, char jobz, char jobf,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Query optimal working array(s) size */
|
/* Query optimal working array(s) size */
|
||||||
info = LAPACKE_sgedmd_work( matrix_layout, jobs, jobz, jobf, whtsvd, m, n,
|
info = LAPACKE_sgedmd_work( matrix_layout, jobs, jobz, jobr, jobf, whtsvd,
|
||||||
x, ldx, y, ldy, k, reig, imeig, z, ldz, res,
|
m, n, x, ldx, y, ldy, nrnk, tol, k, reig, imeig, z, ldz,
|
||||||
b, ldb, w, ldw, s, lds, &work_query, lwork,
|
res, b, ldb, w, ldw, s, lds, &work_query,
|
||||||
&iwork_query, liwork );
|
lwork, &iwork_query, liwork );
|
||||||
|
|
||||||
if( info != 0 ) {
|
if( info != 0 ) {
|
||||||
goto exit_level_0;
|
goto exit_level_0;
|
||||||
|
@ -96,10 +98,10 @@ lapack_int LAPACKE_sgedmd( int matrix_layout, char jobs, char jobz, char jobf,
|
||||||
goto exit_level_1;
|
goto exit_level_1;
|
||||||
}
|
}
|
||||||
/* Call middle-level interface */
|
/* Call middle-level interface */
|
||||||
info = LAPACKE_sgedmd_work( matrix_layout, jobs, jobz, jobf, whtsvd, m, n,
|
info = LAPACKE_sgedmd_work( matrix_layout, jobs, jobz, jobr, jobf, whtsvd,
|
||||||
x, ldx, y, ldy, k, reig, imeig, z, ldz, res,
|
m, n, x, ldx, y, ldy, nrnk, tol, k, reig, imeig, z, ldz,
|
||||||
b, ldb, w, ldw, s, lds, work, lwork, iwork,
|
res, b, ldb, w, ldw, s, lds, work, lwork,
|
||||||
liwork );
|
iwork, liwork );
|
||||||
/* Release memory and exit */
|
/* Release memory and exit */
|
||||||
LAPACKE_free( iwork );
|
LAPACKE_free( iwork );
|
||||||
exit_level_1:
|
exit_level_1:
|
||||||
|
|
|
@ -33,22 +33,23 @@
|
||||||
#include "lapacke_utils.h"
|
#include "lapacke_utils.h"
|
||||||
|
|
||||||
lapack_int LAPACKE_sgedmd_work( int matrix_layout, char jobs, char jobz,
|
lapack_int LAPACKE_sgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
char jobf, lapack_int whtsvd, lapack_int m,
|
char jobr, char jobf, lapack_int whtsvd,
|
||||||
lapack_int n, float* x, lapack_int ldx,
|
lapack_int m, lapack_int n, float* x,
|
||||||
float* y, lapack_int ldy, lapack_int k,
|
lapack_int ldx, float* y, lapack_int ldy,
|
||||||
float* reig, float* imeig, float* z,
|
lapack_int nrnk, float* tol, lapack_int k,
|
||||||
lapack_int ldz, float* res, float* b,
|
float* reig, float* imeig,
|
||||||
lapack_int ldb, float* w, lapack_int ldw,
|
float* z, lapack_int ldz, float* res,
|
||||||
float* s, lapack_int lds, float* work,
|
float* b, lapack_int ldb, float* w,
|
||||||
lapack_int lwork, lapack_int* iwork,
|
lapack_int ldw, float* s, lapack_int lds,
|
||||||
lapack_int liwork )
|
float* work, lapack_int lwork,
|
||||||
|
lapack_int* iwork, lapack_int liwork )
|
||||||
{
|
{
|
||||||
lapack_int info = 0;
|
lapack_int info = 0;
|
||||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_sgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x, &ldx, y, &ldy,
|
LAPACK_sgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x, &ldx, y,
|
||||||
&k, reig, imeig, z, &ldz, res, b, &ldb, w, &ldw, s, &lds,
|
&ldy, &nrnk, tol, &k, reig, imeig, z, &ldz, res, b, &ldb, w, &ldw,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
s, &lds, work, &lwork, iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
}
|
}
|
||||||
|
@ -98,9 +99,10 @@ lapack_int LAPACKE_sgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
}
|
}
|
||||||
/* Query optimal working array(s) size if requested */
|
/* Query optimal working array(s) size if requested */
|
||||||
if( lwork == -1 ) {
|
if( lwork == -1 ) {
|
||||||
LAPACK_sgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x, &ldx, y, &ldy,
|
LAPACK_sgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x,
|
||||||
&k, reig, imeig, z, &ldz, res, b, &ldb, w, &ldw, s, &lds,
|
&ldx, y, &ldy, &nrnk, tol, &k, reig, imeig, z, &ldz, res, b,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
&ldb, w, &ldw, s, &lds, work, &lwork, iwork,
|
||||||
|
&liwork, &info );
|
||||||
return (info < 0) ? (info - 1) : info;
|
return (info < 0) ? (info - 1) : info;
|
||||||
}
|
}
|
||||||
/* Allocate memory for temporary array(s) */
|
/* Allocate memory for temporary array(s) */
|
||||||
|
@ -142,9 +144,10 @@ lapack_int LAPACKE_sgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
LAPACKE_sge_trans( matrix_layout, m, n, w, ldw, w_t, ldw_t );
|
LAPACKE_sge_trans( matrix_layout, m, n, w, ldw, w_t, ldw_t );
|
||||||
LAPACKE_sge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
LAPACKE_sge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_sgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x_t, &ldx_t, y_t,
|
LAPACK_sgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x_t,
|
||||||
&ldy_t, &k, reig, imeig, z_t, &ldz_t, res, b_t, &ldb_t,
|
&ldx_t, y_t, &ldy_t, &nrnk, tol, &k, reig, imeig, z_t, &ldz_t,
|
||||||
w_t, &ldw_t, s_t, &lds_t, work, &lwork, iwork, &liwork, &info );
|
res, b_t, &ldb_t, w_t, &ldw_t, s_t, &lds_t, work,
|
||||||
|
&lwork, iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ lapack_int LAPACKE_sgedmdq( int matrix_layout, char jobs, char jobz, char jobr,
|
||||||
char jobq, char jobt, char jobf, lapack_int whtsvd,
|
char jobq, char jobt, char jobf, lapack_int whtsvd,
|
||||||
lapack_int m, lapack_int n, float* f, lapack_int ldf,
|
lapack_int m, lapack_int n, float* f, lapack_int ldf,
|
||||||
float* x, lapack_int ldx, float* y, lapack_int ldy,
|
float* x, lapack_int ldx, float* y, lapack_int ldy,
|
||||||
lapack_int nrnk, float tol, lapack_int k,
|
lapack_int nrnk, float* tol, lapack_int k,
|
||||||
float* reig, float* imeig, float* z,
|
float* reig, float* imeig, float* z,
|
||||||
lapack_int ldz, float* res, float* b, lapack_int ldb,
|
lapack_int ldz, float* res, float* b, lapack_int ldb,
|
||||||
float* v, lapack_int ldv, float* s, lapack_int lds)
|
float* v, lapack_int ldv, float* s, lapack_int lds)
|
||||||
|
|
|
@ -37,7 +37,7 @@ lapack_int LAPACKE_sgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
lapack_int whtsvd, lapack_int m, lapack_int n,
|
lapack_int whtsvd, lapack_int m, lapack_int n,
|
||||||
float* f, lapack_int ldf, float* x,
|
float* f, lapack_int ldf, float* x,
|
||||||
lapack_int ldx, float* y, lapack_int ldy,
|
lapack_int ldx, float* y, lapack_int ldy,
|
||||||
lapack_int nrnk, float tol, lapack_int k,
|
lapack_int nrnk, float* tol, lapack_int k,
|
||||||
float* reig, float* imeig, float* z,
|
float* reig, float* imeig, float* z,
|
||||||
lapack_int ldz, float* res, float* b,
|
lapack_int ldz, float* res, float* b,
|
||||||
lapack_int ldb, float* v, lapack_int ldv,
|
lapack_int ldb, float* v, lapack_int ldv,
|
||||||
|
@ -49,8 +49,8 @@ lapack_int LAPACKE_sgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_sgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
LAPACK_sgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
||||||
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
|
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, reig, imeig,
|
||||||
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
work, &lwork, iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
|
@ -109,8 +109,8 @@ lapack_int LAPACKE_sgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
/* Query optimal working array(s) size if requested */
|
/* Query optimal working array(s) size if requested */
|
||||||
if( lwork == -1 || liwork == -1 ) {
|
if( lwork == -1 || liwork == -1 ) {
|
||||||
LAPACK_sgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
LAPACK_sgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
||||||
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
|
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, reig, imeig,
|
||||||
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
work, &lwork, iwork, &liwork, &info );
|
||||||
return (info < 0) ? (info - 1) : info;
|
return (info < 0) ? (info - 1) : info;
|
||||||
}
|
}
|
||||||
|
@ -160,8 +160,8 @@ lapack_int LAPACKE_sgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
LAPACKE_sge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
LAPACKE_sge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_sgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
LAPACK_sgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
||||||
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
|
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, reig, imeig,
|
||||||
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
work, &lwork, iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
|
|
|
@ -32,24 +32,28 @@
|
||||||
|
|
||||||
#include "lapacke_utils.h"
|
#include "lapacke_utils.h"
|
||||||
|
|
||||||
lapack_int LAPACKE_zgedmd( int matrix_layout, char jobs, char jobz, char jobf,
|
lapack_int LAPACKE_zgedmd( int matrix_layout, char jobs, char jobz, char jobr,
|
||||||
lapack_int whtsvd, lapack_int m, lapack_int n,
|
char jobf, lapack_int whtsvd, lapack_int m,
|
||||||
lapack_complex_double* x, lapack_int ldx,
|
lapack_int n, lapack_complex_double* x,
|
||||||
lapack_complex_double* y, lapack_int ldy,
|
lapack_int ldx, lapack_complex_double* y,
|
||||||
lapack_int k, lapack_complex_double* reig,
|
lapack_int ldy, lapack_int nrnk, double *tol, lapack_int k,
|
||||||
lapack_complex_double* imeig, lapack_complex_double* z,
|
lapack_complex_double* eigs, lapack_complex_double* z,
|
||||||
lapack_int ldz, lapack_complex_double* res,
|
lapack_int ldz, double* res,
|
||||||
lapack_complex_double* b, lapack_int ldb,
|
lapack_complex_double* b, lapack_int ldb,
|
||||||
|
lapack_complex_double* zw, lapack_int lzw,
|
||||||
lapack_complex_double* w, lapack_int ldw,
|
lapack_complex_double* w, lapack_int ldw,
|
||||||
lapack_complex_double* s, lapack_int lds)
|
lapack_complex_double* s, lapack_int lds)
|
||||||
{
|
{
|
||||||
lapack_int info = 0;
|
lapack_int info = 0;
|
||||||
lapack_int lwork = -1;
|
lapack_int lwork = -1;
|
||||||
lapack_int liwork = -1;
|
lapack_int liwork = -1;
|
||||||
lapack_complex_double* work = NULL;
|
lapack_int lzwork = -1;
|
||||||
|
lapack_complex_double* zwork = NULL;
|
||||||
|
double* work = NULL;
|
||||||
lapack_int* iwork = NULL;
|
lapack_int* iwork = NULL;
|
||||||
lapack_complex_double work_query;
|
double work_query;
|
||||||
lapack_int iwork_query;
|
lapack_int iwork_query;
|
||||||
|
lapack_complex_double zwork_query;
|
||||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||||
LAPACKE_xerbla( "LAPACKE_zgedmd", -1 );
|
LAPACKE_xerbla( "LAPACKE_zgedmd", -1 );
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -78,36 +82,44 @@ lapack_int LAPACKE_zgedmd( int matrix_layout, char jobs, char jobz, char jobf,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Query optimal working array(s) size */
|
/* Query optimal working array(s) size */
|
||||||
info = LAPACKE_zgedmd_work( matrix_layout, jobs, jobz, jobf, whtsvd, m, n,
|
info = LAPACKE_zgedmd_work( matrix_layout, jobs, jobz, jobr, jobf, whtsvd,
|
||||||
x, ldx, y, ldy, k, reig, imeig, z, ldz, res,
|
m, n, x, ldx, y, ldy, nrnk, tol, k, eigs, z, ldz,
|
||||||
b, ldb, w, ldw, s, lds, &work_query, lwork,
|
res, b, ldb, w, ldw, s, lds, &zwork_query, lzwork,
|
||||||
&iwork_query, liwork );
|
&work_query, lwork, &iwork_query, liwork );
|
||||||
|
|
||||||
if( info != 0 ) {
|
if( info != 0 ) {
|
||||||
goto exit_level_0;
|
goto exit_level_0;
|
||||||
}
|
}
|
||||||
lwork = LAPACK_Z2INT( work_query );
|
lwork = LAPACK_Z2INT( work_query );
|
||||||
liwork = iwork_query;
|
liwork = iwork_query;
|
||||||
|
lzwork = LAPACK_Z2INT( zwork_query );
|
||||||
/* Allocate memory for work arrays */
|
/* Allocate memory for work arrays */
|
||||||
work = (lapack_complex_double*)LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
|
zwork = (lapack_complex_double*)LAPACKE_malloc( sizeof(lapack_complex_double) * lzwork );
|
||||||
if( work == NULL ) {
|
if( zwork == NULL ) {
|
||||||
info = LAPACK_WORK_MEMORY_ERROR;
|
info = LAPACK_WORK_MEMORY_ERROR;
|
||||||
goto exit_level_0;
|
goto exit_level_0;
|
||||||
}
|
}
|
||||||
|
work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
|
||||||
|
if( work == NULL ) {
|
||||||
|
info = LAPACK_WORK_MEMORY_ERROR;
|
||||||
|
goto exit_level_1;
|
||||||
|
}
|
||||||
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
|
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
|
||||||
if( iwork == NULL ) {
|
if( iwork == NULL ) {
|
||||||
info = LAPACK_WORK_MEMORY_ERROR;
|
info = LAPACK_WORK_MEMORY_ERROR;
|
||||||
goto exit_level_1;
|
goto exit_level_2;
|
||||||
}
|
}
|
||||||
/* Call middle-level interface */
|
/* Call middle-level interface */
|
||||||
info = LAPACKE_zgedmd_work( matrix_layout, jobs, jobz, jobf, whtsvd, m, n,
|
info = LAPACKE_zgedmd_work( matrix_layout, jobs, jobz, jobr, jobf, whtsvd,
|
||||||
x, ldx, y, ldy, k, reig, imeig, z, ldz, res,
|
m, n, x, ldx, y, ldy, nrnk, tol, k, eigs, z, ldz,
|
||||||
b, ldb, w, ldw, s, lds, work, lwork, iwork,
|
res, b, ldb, w, ldw, s, lds, zwork, lzwork,
|
||||||
liwork );
|
work, lwork, iwork, liwork );
|
||||||
/* Release memory and exit */
|
/* Release memory and exit */
|
||||||
LAPACKE_free( iwork );
|
LAPACKE_free( iwork );
|
||||||
exit_level_1:
|
exit_level_2:
|
||||||
LAPACKE_free( work );
|
LAPACKE_free( work );
|
||||||
|
exit_level_1:
|
||||||
|
LAPACKE_free( zwork );
|
||||||
exit_level_0:
|
exit_level_0:
|
||||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||||
LAPACKE_xerbla( "LAPACKE_zgedmd", info );
|
LAPACKE_xerbla( "LAPACKE_zgedmd", info );
|
||||||
|
|
|
@ -33,25 +33,27 @@
|
||||||
#include "lapacke_utils.h"
|
#include "lapacke_utils.h"
|
||||||
|
|
||||||
lapack_int LAPACKE_zgedmd_work( int matrix_layout, char jobs, char jobz,
|
lapack_int LAPACKE_zgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
char jobf, lapack_int whtsvd, lapack_int m,
|
char jobr, char jobf, lapack_int whtsvd,
|
||||||
lapack_int n, lapack_complex_double* x,
|
lapack_int m, lapack_int n,
|
||||||
|
lapack_complex_double* x,
|
||||||
lapack_int ldx, lapack_complex_double* y,
|
lapack_int ldx, lapack_complex_double* y,
|
||||||
lapack_int ldy, lapack_int k,
|
lapack_int ldy, lapack_int nrnk, double *tol, lapack_int k,
|
||||||
lapack_complex_double* reig,
|
lapack_complex_double* eigs, lapack_complex_double* z,
|
||||||
lapack_complex_double* imeig, lapack_complex_double* z,
|
lapack_int ldz, double* res,
|
||||||
lapack_int ldz, lapack_complex_double* res,
|
|
||||||
lapack_complex_double* b, lapack_int ldb,
|
lapack_complex_double* b, lapack_int ldb,
|
||||||
lapack_complex_double* w, lapack_int ldw,
|
lapack_complex_double* w, lapack_int ldw,
|
||||||
lapack_complex_double* s, lapack_int lds,
|
lapack_complex_double* s, lapack_int lds,
|
||||||
lapack_complex_double* work, lapack_int lwork,
|
lapack_complex_double* zwork, lapack_int lzwork,
|
||||||
|
double* work, lapack_int lwork,
|
||||||
lapack_int* iwork, lapack_int liwork )
|
lapack_int* iwork, lapack_int liwork )
|
||||||
{
|
{
|
||||||
lapack_int info = 0;
|
lapack_int info = 0;
|
||||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_zgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x, &ldx, y, &ldy,
|
LAPACK_zgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x, &ldx,
|
||||||
&k, reig, imeig, z, &ldz, res, b, &ldb, w, &ldw, s, &lds,
|
y, &ldy, &nrnk, tol, &k, eigs, z, &ldz, res, b, &ldb, w,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
&ldw, s, &lds, zwork, &lzwork, work, &lwork, iwork,
|
||||||
|
&liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
}
|
}
|
||||||
|
@ -101,9 +103,10 @@ lapack_int LAPACKE_zgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
}
|
}
|
||||||
/* Query optimal working array(s) size if requested */
|
/* Query optimal working array(s) size if requested */
|
||||||
if( lwork == -1 ) {
|
if( lwork == -1 ) {
|
||||||
LAPACK_zgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x, &ldx, y, &ldy,
|
LAPACK_zgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x,
|
||||||
&k, reig, imeig, z, &ldz, res, b, &ldb, w, &ldw, s, &lds,
|
&ldx, y, &ldy, &nrnk, tol, &k, eigs, z, &ldz, res, b,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
&ldb, w, &ldw, s, &lds, zwork, &lzwork, work,
|
||||||
|
&lwork, iwork, &liwork, &info );
|
||||||
return (info < 0) ? (info - 1) : info;
|
return (info < 0) ? (info - 1) : info;
|
||||||
}
|
}
|
||||||
/* Allocate memory for temporary array(s) */
|
/* Allocate memory for temporary array(s) */
|
||||||
|
@ -145,9 +148,10 @@ lapack_int LAPACKE_zgedmd_work( int matrix_layout, char jobs, char jobz,
|
||||||
LAPACKE_zge_trans( matrix_layout, m, n, w, ldw, w_t, ldw_t );
|
LAPACKE_zge_trans( matrix_layout, m, n, w, ldw, w_t, ldw_t );
|
||||||
LAPACKE_zge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
LAPACKE_zge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_zgedmd( &jobs, &jobz, &jobf, &whtsvd, &m, &n, x_t, &ldx_t, y_t,
|
LAPACK_zgedmd( &jobs, &jobz, &jobr, &jobf, &whtsvd, &m, &n, x_t,
|
||||||
&ldy_t, &k, reig, imeig, z_t, &ldz_t, res, b_t, &ldb_t,
|
&ldx_t, y_t, &ldy_t, &nrnk, tol, &k, eigs, z_t, &ldz_t,
|
||||||
w_t, &ldw_t, s_t, &lds_t, work, &lwork, iwork, &liwork, &info );
|
res, b_t, &ldb_t, w_t, &ldw_t, s_t, &lds_t, zwork,
|
||||||
|
&lzwork, work, &lwork, iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,23 +37,25 @@ lapack_int LAPACKE_zgedmdq( int matrix_layout, char jobs, char jobz, char jobr,
|
||||||
lapack_int m, lapack_int n, lapack_complex_double* f,
|
lapack_int m, lapack_int n, lapack_complex_double* f,
|
||||||
lapack_int ldf, lapack_complex_double* x,
|
lapack_int ldf, lapack_complex_double* x,
|
||||||
lapack_int ldx, lapack_complex_double* y,
|
lapack_int ldx, lapack_complex_double* y,
|
||||||
lapack_int ldy, lapack_int nrnk, double tol,
|
lapack_int ldy, lapack_int nrnk, double* tol,
|
||||||
lapack_int k, lapack_complex_double* reig,
|
lapack_int k, lapack_complex_double* eigs,
|
||||||
lapack_complex_double* imeig,
|
|
||||||
lapack_complex_double* z, lapack_int ldz,
|
lapack_complex_double* z, lapack_int ldz,
|
||||||
lapack_complex_double* res, lapack_complex_double* b,
|
double* res, lapack_complex_double* b,
|
||||||
lapack_int ldb, lapack_complex_double* v,
|
lapack_int ldb, lapack_complex_double* v,
|
||||||
lapack_int ldv, lapack_complex_double* s, lapack_int lds)
|
lapack_int ldv, lapack_complex_double* s, lapack_int lds)
|
||||||
{
|
{
|
||||||
lapack_int info = 0;
|
lapack_int info = 0;
|
||||||
lapack_int lwork = -1;
|
lapack_int lwork = -1;
|
||||||
lapack_int liwork = -1;
|
lapack_int liwork = -1;
|
||||||
lapack_complex_double* work = NULL;
|
lapack_int lzwork = -1;
|
||||||
|
lapack_complex_double* zwork = NULL;
|
||||||
|
double* work = NULL;
|
||||||
lapack_int* iwork = NULL;
|
lapack_int* iwork = NULL;
|
||||||
lapack_complex_double work_query;
|
double work_query;
|
||||||
|
lapack_complex_double zwork_query;
|
||||||
lapack_int iwork_query;
|
lapack_int iwork_query;
|
||||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||||
LAPACKE_xerbla( "LAPACKE_cgedmdq", -1 );
|
LAPACKE_xerbla( "LAPACKE_zgedmdq", -1 );
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||||
|
@ -85,36 +87,44 @@ lapack_int LAPACKE_zgedmdq( int matrix_layout, char jobs, char jobz, char jobr,
|
||||||
/* Query optimal working array(s) size */
|
/* Query optimal working array(s) size */
|
||||||
info = LAPACKE_zgedmdq_work( matrix_layout, jobs, jobz, jobr, jobq, jobt,
|
info = LAPACKE_zgedmdq_work( matrix_layout, jobs, jobz, jobr, jobq, jobt,
|
||||||
jobf, whtsvd, m, n, f, ldf, x, ldx, y, ldy,
|
jobf, whtsvd, m, n, f, ldf, x, ldx, y, ldy,
|
||||||
nrnk, tol, k, reig, imeig, z, ldz, res,
|
nrnk, tol, k, eigs, z, ldz, res,
|
||||||
b, ldb, v, ldv, s, lds, &work_query, lwork,
|
b, ldb, v, ldv, s, lds, &zwork_query, lzwork,
|
||||||
&iwork_query, liwork );
|
&work_query, lwork, &iwork_query, liwork );
|
||||||
|
|
||||||
if( info != 0 ) {
|
if( info != 0 ) {
|
||||||
goto exit_level_0;
|
goto exit_level_0;
|
||||||
}
|
}
|
||||||
lwork = LAPACK_Z2INT( work_query );
|
lwork = LAPACK_Z2INT( work_query );
|
||||||
|
lzwork = LAPACK_Z2INT( zwork_query );
|
||||||
liwork = iwork_query;
|
liwork = iwork_query;
|
||||||
/* Allocate memory for work arrays */
|
/* Allocate memory for work arrays */
|
||||||
work = (lapack_complex_double*)LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
|
zwork = (lapack_complex_double*)LAPACKE_malloc( sizeof(lapack_complex_double) * lzwork );
|
||||||
if( work == NULL ) {
|
if( zwork == NULL ) {
|
||||||
info = LAPACK_WORK_MEMORY_ERROR;
|
info = LAPACK_WORK_MEMORY_ERROR;
|
||||||
goto exit_level_0;
|
goto exit_level_0;
|
||||||
}
|
}
|
||||||
|
work = (double*)LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
|
||||||
|
if( work == NULL ) {
|
||||||
|
info = LAPACK_WORK_MEMORY_ERROR;
|
||||||
|
goto exit_level_1;
|
||||||
|
}
|
||||||
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
|
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
|
||||||
if( iwork == NULL ) {
|
if( iwork == NULL ) {
|
||||||
info = LAPACK_WORK_MEMORY_ERROR;
|
info = LAPACK_WORK_MEMORY_ERROR;
|
||||||
goto exit_level_1;
|
goto exit_level_2;
|
||||||
}
|
}
|
||||||
/* Call middle-level interface */
|
/* Call middle-level interface */
|
||||||
info = LAPACKE_zgedmdq_work( matrix_layout, jobs, jobz, jobr, jobq, jobt,
|
info = LAPACKE_zgedmdq_work( matrix_layout, jobs, jobz, jobr, jobq, jobt,
|
||||||
jobf, whtsvd, m, n, f, ldf, x, ldx, y, ldy,
|
jobf, whtsvd, m, n, f, ldf, x, ldx, y, ldy,
|
||||||
nrnk, tol, k, reig, imeig, z, ldz, res,
|
nrnk, tol, k, eigs, z, ldz, res,
|
||||||
b, ldb, v, ldv, s, lds, work, lwork, iwork,
|
b, ldb, v, ldv, s, lds, zwork, lzwork,
|
||||||
liwork );
|
work, lwork, iwork, liwork );
|
||||||
/* Release memory and exit */
|
/* Release memory and exit */
|
||||||
LAPACKE_free( iwork );
|
LAPACKE_free( iwork );
|
||||||
exit_level_1:
|
exit_level_2:
|
||||||
LAPACKE_free( work );
|
LAPACKE_free( work );
|
||||||
|
exit_level_1:
|
||||||
|
LAPACKE_free( zwork );
|
||||||
exit_level_0:
|
exit_level_0:
|
||||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||||
LAPACKE_xerbla( "LAPACKE_zgedmdq", info );
|
LAPACKE_xerbla( "LAPACKE_zgedmdq", info );
|
||||||
|
|
|
@ -38,15 +38,15 @@ lapack_int LAPACKE_zgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
lapack_complex_double* f, lapack_int ldf,
|
lapack_complex_double* f, lapack_int ldf,
|
||||||
lapack_complex_double* x, lapack_int ldx,
|
lapack_complex_double* x, lapack_int ldx,
|
||||||
lapack_complex_double* y, lapack_int ldy,
|
lapack_complex_double* y, lapack_int ldy,
|
||||||
lapack_int nrnk, double tol, lapack_int k,
|
lapack_int nrnk, double* tol, lapack_int k,
|
||||||
lapack_complex_double* reig,
|
lapack_complex_double* eigs,
|
||||||
lapack_complex_double* imeig,
|
|
||||||
lapack_complex_double* z,
|
lapack_complex_double* z,
|
||||||
lapack_int ldz, lapack_complex_double* res,
|
lapack_int ldz, double* res,
|
||||||
lapack_complex_double* b,
|
lapack_complex_double* b,
|
||||||
lapack_int ldb, lapack_complex_double* v,
|
lapack_int ldb, lapack_complex_double* v,
|
||||||
lapack_int ldv, lapack_complex_double* s,
|
lapack_int ldv, lapack_complex_double* s,
|
||||||
lapack_int lds, lapack_complex_double* work,
|
lapack_int lds, lapack_complex_double* zwork,
|
||||||
|
lapack_int lzwork, double* work,
|
||||||
lapack_int lwork, lapack_int* iwork,
|
lapack_int lwork, lapack_int* iwork,
|
||||||
lapack_int liwork )
|
lapack_int liwork )
|
||||||
{
|
{
|
||||||
|
@ -54,9 +54,9 @@ lapack_int LAPACKE_zgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_zgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
LAPACK_zgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
||||||
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
|
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, eigs,
|
||||||
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
zwork, &lzwork, work, &lwork, iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
}
|
}
|
||||||
|
@ -114,9 +114,9 @@ lapack_int LAPACKE_zgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
/* Query optimal working array(s) size if requested */
|
/* Query optimal working array(s) size if requested */
|
||||||
if( lwork == -1 || liwork == -1 ) {
|
if( lwork == -1 || liwork == -1 ) {
|
||||||
LAPACK_zgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
LAPACK_zgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
||||||
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
|
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, eigs,
|
||||||
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
zwork, &lzwork, work, &lwork, iwork, &liwork, &info );
|
||||||
return (info < 0) ? (info - 1) : info;
|
return (info < 0) ? (info - 1) : info;
|
||||||
}
|
}
|
||||||
/* Allocate memory for temporary array(s) */
|
/* Allocate memory for temporary array(s) */
|
||||||
|
@ -165,9 +165,9 @@ lapack_int LAPACKE_zgedmdq_work( int matrix_layout, char jobs, char jobz,
|
||||||
LAPACKE_zge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
LAPACKE_zge_trans( matrix_layout, m, n, s, lds, s_t, lds_t );
|
||||||
/* Call LAPACK function and adjust info */
|
/* Call LAPACK function and adjust info */
|
||||||
LAPACK_zgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
LAPACK_zgedmdq( &jobs, &jobz, &jobr, &jobq, &jobt, &jobf, &whtsvd, &m,
|
||||||
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, &tol, &k, reig,
|
&n, f, &ldf, x, &ldx, y, &ldy, &nrnk, tol, &k, eigs,
|
||||||
imeig, z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
z, &ldz, res, b, &ldb, v, &ldv, s, &lds,
|
||||||
work, &lwork, iwork, &liwork, &info );
|
zwork, &lzwork, work, &lwork, iwork, &liwork, &info );
|
||||||
if( info < 0 ) {
|
if( info < 0 ) {
|
||||||
info = info - 1;
|
info = info - 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue