本文整理汇总了C++中LAPACK_Z2INT函数的典型用法代码示例。如果您正苦于以下问题:C++ LAPACK_Z2INT函数的具体用法?C++ LAPACK_Z2INT怎么用?C++ LAPACK_Z2INT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LAPACK_Z2INT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LAPACKE_zgeevx
lapack_int LAPACKE_zgeevx( int matrix_order, char balanc, char jobvl,
char jobvr, char sense, lapack_int n,
lapack_complex_double* a, lapack_int lda,
lapack_complex_double* w, lapack_complex_double* vl,
lapack_int ldvl, lapack_complex_double* vr,
lapack_int ldvr, lapack_int* ilo, lapack_int* ihi,
double* scale, double* abnrm, double* rconde,
double* rcondv )
{
lapack_int info = 0;
lapack_int lwork = -1;
double* rwork = NULL;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zgeevx", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_zge_nancheck( matrix_order, n, n, a, lda ) ) {
return -7;
}
#endif
/* Allocate memory for working array(s) */
rwork = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,2*n) );
if( rwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Query optimal working array(s) size */
info = LAPACKE_zgeevx_work( matrix_order, balanc, jobvl, jobvr, sense, n, a,
lda, w, vl, ldvl, vr, ldvr, ilo, ihi, scale,
abnrm, rconde, rcondv, &work_query, lwork,
rwork );
if( info != 0 ) {
goto exit_level_1;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for work arrays */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_zgeevx_work( matrix_order, balanc, jobvl, jobvr, sense, n, a,
lda, w, vl, ldvl, vr, ldvr, ilo, ihi, scale,
abnrm, rconde, rcondv, work, lwork, rwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zgeevx", info );
}
return info;
}
示例2: LAPACKE_zgelss
lapack_int LAPACKE_zgelss( int matrix_order, lapack_int m, lapack_int n,
lapack_int nrhs, lapack_complex_double* a,
lapack_int lda, lapack_complex_double* b,
lapack_int ldb, double* s, double rcond,
lapack_int* rank )
{
lapack_int info = 0;
lapack_int lwork = -1;
double* rwork = NULL;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zgelss", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_zge_nancheck( matrix_order, m, n, a, lda ) ) {
return -5;
}
if( LAPACKE_zge_nancheck( matrix_order, MAX(m,n), nrhs, b, ldb ) ) {
return -7;
}
if( LAPACKE_d_nancheck( 1, &rcond, 1 ) ) {
return -10;
}
#endif
/* Allocate memory for working array(s) */
rwork = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,5*MIN(m,n)) );
if( rwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Query optimal working array(s) size */
info = LAPACKE_zgelss_work( matrix_order, m, n, nrhs, a, lda, b, ldb, s,
rcond, rank, &work_query, lwork, rwork );
if( info != 0 ) {
goto exit_level_1;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for work arrays */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_zgelss_work( matrix_order, m, n, nrhs, a, lda, b, ldb, s,
rcond, rank, work, lwork, rwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zgelss", info );
}
return info;
}
示例3: LAPACKE_zgesvd
lapack_int LAPACKE_zgesvd( int matrix_order, char jobu, char jobvt,
lapack_int m, lapack_int n, lapack_complex_double* a,
lapack_int lda, double* s, lapack_complex_double* u,
lapack_int ldu, lapack_complex_double* vt,
lapack_int ldvt, double* superb )
{
lapack_int info = 0;
lapack_int lwork = -1;
double* rwork = NULL;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
lapack_int i;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zgesvd", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_zge_nancheck( matrix_order, m, n, a, lda ) ) {
return -6;
}
#endif
/* Allocate memory for working array(s) */
rwork = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,5*MIN(m,n)) );
if( rwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Query optimal working array(s) size */
info = LAPACKE_zgesvd_work( matrix_order, jobu, jobvt, m, n, a, lda, s, u,
ldu, vt, ldvt, &work_query, lwork, rwork );
if( info != 0 ) {
goto exit_level_1;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for work arrays */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_zgesvd_work( matrix_order, jobu, jobvt, m, n, a, lda, s, u,
ldu, vt, ldvt, work, lwork, rwork );
/* Backup significant data from working array(s) */
for( i=0; i<MIN(m,n)-1; i++ ) {
superb[i] = rwork[i];
}
/* Release memory and exit */
LAPACKE_free( work );
exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zgesvd", info );
}
return info;
}
示例4: LAPACKE_zhegv
lapack_int LAPACKE_zhegv( int matrix_order, lapack_int itype, char jobz,
char uplo, lapack_int n, lapack_complex_double* a,
lapack_int lda, lapack_complex_double* b,
lapack_int ldb, double* w )
{
lapack_int info = 0;
lapack_int lwork = -1;
double* rwork = NULL;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zhegv", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_zge_nancheck( matrix_order, n, n, a, lda ) ) {
return -6;
}
if( LAPACKE_zge_nancheck( matrix_order, n, n, b, ldb ) ) {
return -8;
}
#endif
/* Allocate memory for working array(s) */
rwork = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,3*n-2) );
if( rwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Query optimal working array(s) size */
info = LAPACKE_zhegv_work( matrix_order, itype, jobz, uplo, n, a, lda, b,
ldb, w, &work_query, lwork, rwork );
if( info != 0 ) {
goto exit_level_1;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for work arrays */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_zhegv_work( matrix_order, itype, jobz, uplo, n, a, lda, b,
ldb, w, work, lwork, rwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zhegv", info );
}
return info;
}
示例5: LAPACKE_zgglse
lapack_int LAPACKE_zgglse( int matrix_order, lapack_int m, lapack_int n,
lapack_int p, lapack_complex_double* a,
lapack_int lda, lapack_complex_double* b,
lapack_int ldb, lapack_complex_double* c,
lapack_complex_double* d, lapack_complex_double* x )
{
lapack_int info = 0;
lapack_int lwork = -1;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zgglse", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_zge_nancheck( matrix_order, m, n, a, lda ) ) {
return -5;
}
if( LAPACKE_zge_nancheck( matrix_order, p, n, b, ldb ) ) {
return -7;
}
if( LAPACKE_z_nancheck( m, c, 1 ) ) {
return -9;
}
if( LAPACKE_z_nancheck( p, d, 1 ) ) {
return -10;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_zgglse_work( matrix_order, m, n, p, a, lda, b, ldb, c, d, x,
&work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for work arrays */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_zgglse_work( matrix_order, m, n, p, a, lda, b, ldb, c, d, x,
work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zgglse", info );
}
return info;
}
示例6: LAPACKE_zgeqp3
lapack_int LAPACKE_zgeqp3( int matrix_layout, lapack_int m, lapack_int n,
lapack_complex_double* a, lapack_int lda,
lapack_int* jpvt, lapack_complex_double* tau )
{
lapack_int info = 0;
lapack_int lwork = -1;
double* rwork = NULL;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zgeqp3", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_zge_nancheck( matrix_layout, m, n, a, lda ) ) {
return -4;
}
}
#endif
/* Allocate memory for working array(s) */
rwork = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,2*n) );
if( rwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Query optimal working array(s) size */
info = LAPACKE_zgeqp3_work( matrix_layout, m, n, a, lda, jpvt, tau,
&work_query, lwork, rwork );
if( info != 0 ) {
goto exit_level_1;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for work arrays */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_zgeqp3_work( matrix_layout, m, n, a, lda, jpvt, tau, work,
lwork, rwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zgeqp3", info );
}
return info;
}
示例7: LAPACKE_zunmtr
lapack_int LAPACKE_zunmtr( int matrix_layout, char side, char uplo, char trans,
lapack_int m, lapack_int n,
const lapack_complex_double* a, lapack_int lda,
const lapack_complex_double* tau,
lapack_complex_double* c, lapack_int ldc )
{
lapack_int info = 0;
lapack_int lwork = -1;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
lapack_int r;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zunmtr", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
r = LAPACKE_lsame( side, 'l' ) ? m : n;
if( LAPACKE_zge_nancheck( matrix_layout, r, r, a, lda ) ) {
return -7;
}
if( LAPACKE_zge_nancheck( matrix_layout, m, n, c, ldc ) ) {
return -10;
}
if( LAPACKE_z_nancheck( m-1, tau, 1 ) ) {
return -9;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_zunmtr_work( matrix_layout, side, uplo, trans, m, n, a, lda,
tau, c, ldc, &work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for work arrays */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_zunmtr_work( matrix_layout, side, uplo, trans, m, n, a, lda,
tau, c, ldc, work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zunmtr", info );
}
return info;
}
示例8: LAPACKE_zhetrf_aa_2stage
lapack_int LAPACKE_zhetrf_aa_2stage( int matrix_layout, char uplo, lapack_int n,
lapack_complex_double* a,
lapack_int lda, lapack_complex_double* tb,
lapack_int ltb, lapack_int* ipiv, lapack_int* ipiv2 )
{
lapack_int info = 0;
lapack_int lwork = -1;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zhetrf_aa_2stage", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_zhe_nancheck( matrix_layout, uplo, n, a, lda ) ) {
return -5;
}
if( LAPACKE_zge_nancheck( matrix_layout, 4*n, 1, tb, ltb ) ) {
return -7;
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_zhetrf_aa_2stage_work( matrix_layout, uplo, n,
a, lda, tb, ltb, ipiv, ipiv2,
&work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for work arrays */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_zhetrf_aa_2stage_work( matrix_layout, uplo, n,
a, lda, tb, ltb, ipiv, ipiv2,
work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zhetrf_aa_2stage", info );
}
return info;
}
示例9: LAPACKE_ztrsen
lapack_int LAPACKE_ztrsen( int matrix_layout, char job, char compq,
const lapack_logical* select, lapack_int n,
lapack_complex_double* t, lapack_int ldt,
lapack_complex_double* q, lapack_int ldq,
lapack_complex_double* w, lapack_int* m, double* s,
double* sep )
{
lapack_int info = 0;
lapack_int lwork = -1;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_ztrsen", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_lsame( compq, 'v' ) ) {
if( LAPACKE_zge_nancheck( matrix_layout, n, n, q, ldq ) ) {
return -8;
}
}
if( LAPACKE_zge_nancheck( matrix_layout, n, n, t, ldt ) ) {
return -6;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_ztrsen_work( matrix_layout, job, compq, select, n, t, ldt, q,
ldq, w, m, s, sep, &work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for work arrays */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_ztrsen_work( matrix_layout, job, compq, select, n, t, ldt, q,
ldq, w, m, s, sep, work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_ztrsen", info );
}
return info;
}
示例10: LAPACKE_zhseqr
lapack_int LAPACKE_zhseqr( int matrix_layout, char job, char compz, lapack_int n,
lapack_int ilo, lapack_int ihi,
lapack_complex_double* h, lapack_int ldh,
lapack_complex_double* w, lapack_complex_double* z,
lapack_int ldz )
{
lapack_int info = 0;
lapack_int lwork = -1;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zhseqr", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_zge_nancheck( matrix_layout, n, n, h, ldh ) ) {
return -7;
}
if( LAPACKE_lsame( compz, 'i' ) || LAPACKE_lsame( compz, 'v' ) ) {
if( LAPACKE_zge_nancheck( matrix_layout, n, n, z, ldz ) ) {
return -10;
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_zhseqr_work( matrix_layout, job, compz, n, ilo, ihi, h, ldh,
w, z, ldz, &work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for work arrays */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_zhseqr_work( matrix_layout, job, compz, n, ilo, ihi, h, ldh,
w, z, ldz, work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zhseqr", info );
}
return info;
}
示例11: LAPACKE_zsytri_3
lapack_int LAPACKE_zsytri_3( int matrix_layout, char uplo, lapack_int n,
lapack_complex_double* a, lapack_int lda,
const lapack_complex_double* e, const lapack_int* ipiv )
{
lapack_int info = 0;
lapack_int lwork = -1;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
lapack_int e_start = LAPACKE_lsame( uplo, 'U' ) ? 1 : 0;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zsytri_3", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_zsy_nancheck( matrix_layout, uplo, n, a, lda ) ) {
return -4;
}
if( LAPACKE_z_nancheck( n-1, e + e_start, 1 ) ) {
return -6;
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_zsytri_3_work( matrix_layout, uplo, n, a, lda, e, ipiv,
&work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for working array(s) */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_zsytri_3_work( matrix_layout, uplo, n, a, lda, e, ipiv, work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zsytri_3", info );
}
return info;
}
示例12: LAPACKE_zgetsls
lapack_int LAPACKE_zgetsls( int matrix_layout, char trans, lapack_int m,
lapack_int n, lapack_int nrhs,
lapack_complex_double* a, lapack_int lda,
lapack_complex_double* b, lapack_int ldb )
{
lapack_int info = 0;
lapack_int lwork = -1;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zgetsls", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_zge_nancheck( matrix_layout, m, n, a, lda ) ) {
return -6;
}
if( LAPACKE_zge_nancheck( matrix_layout, MAX(m,n), nrhs, b, ldb ) ) {
return -8;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_zgetsls_work( matrix_layout, trans, m, n, nrhs, a, lda, b, ldb,
&work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for work arrays */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_zgetsls_work( matrix_layout, trans, m, n, nrhs, a, lda, b, ldb,
work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zgetsls", info );
}
return info;
}
示例13: LAPACKE_zungtr
lapack_int LAPACKE_zungtr( int matrix_order, char uplo, lapack_int n,
lapack_complex_double* a, lapack_int lda,
const lapack_complex_double* tau )
{
lapack_int info = 0;
lapack_int lwork = -1;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zungtr", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_zge_nancheck( matrix_order, n, n, a, lda ) ) {
return -4;
}
if( LAPACKE_z_nancheck( n-1, tau, 1 ) ) {
return -6;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_zungtr_work( matrix_order, uplo, n, a, lda, tau, &work_query,
lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for work arrays */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_zungtr_work( matrix_order, uplo, n, a, lda, tau, work,
lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zungtr", info );
}
return info;
}
示例14: LAPACKE_zggevx
lapack_int LAPACKE_zggevx( int matrix_layout, char balanc, char jobvl,
char jobvr, char sense, lapack_int n,
lapack_complex_double* a, lapack_int lda,
lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* alpha,
lapack_complex_double* beta,
lapack_complex_double* vl, lapack_int ldvl,
lapack_complex_double* vr, lapack_int ldvr,
lapack_int* ilo, lapack_int* ihi, double* lscale,
double* rscale, double* abnrm, double* bbnrm,
double* rconde, double* rcondv )
{
lapack_int info = 0;
lapack_int lwork = -1;
/* Additional scalars declarations for work arrays */
lapack_int lrwork;
lapack_logical* bwork = NULL;
lapack_int* iwork = NULL;
double* rwork = NULL;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zggevx", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_zge_nancheck( matrix_layout, n, n, a, lda ) ) {
return -7;
}
if( LAPACKE_zge_nancheck( matrix_layout, n, n, b, ldb ) ) {
return -9;
}
}
#endif
/* Additional scalars initializations for work arrays */
if( LAPACKE_lsame( balanc, 's' ) || LAPACKE_lsame( balanc, 'b' ) ) {
lrwork = MAX(1,6*n);
} else {
lrwork = MAX(1,2*n);
}
/* Allocate memory for working array(s) */
if( LAPACKE_lsame( sense, 'b' ) || LAPACKE_lsame( sense, 'e' ) ||
LAPACKE_lsame( sense, 'v' ) ) {
bwork = (lapack_logical*)
LAPACKE_malloc( sizeof(lapack_logical) * MAX(1,n) );
if( bwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
}
if( LAPACKE_lsame( sense, 'b' ) || LAPACKE_lsame( sense, 'n' ) ||
LAPACKE_lsame( sense, 'v' ) ) {
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,n+2) );
if( iwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
}
rwork = (double*)LAPACKE_malloc( sizeof(double) * lrwork );
if( rwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_2;
}
/* Query optimal working array(s) size */
info = LAPACKE_zggevx_work( matrix_layout, balanc, jobvl, jobvr, sense, n, a,
lda, b, ldb, alpha, beta, vl, ldvl, vr, ldvr,
ilo, ihi, lscale, rscale, abnrm, bbnrm, rconde,
rcondv, &work_query, lwork, rwork, iwork,
bwork );
if( info != 0 ) {
goto exit_level_3;
}
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for work arrays */
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_3;
}
/* Call middle-level interface */
info = LAPACKE_zggevx_work( matrix_layout, balanc, jobvl, jobvr, sense, n, a,
lda, b, ldb, alpha, beta, vl, ldvl, vr, ldvr,
ilo, ihi, lscale, rscale, abnrm, bbnrm, rconde,
rcondv, work, lwork, rwork, iwork, bwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_3:
LAPACKE_free( rwork );
exit_level_2:
if( LAPACKE_lsame( sense, 'b' ) || LAPACKE_lsame( sense, 'n' ) ||
LAPACKE_lsame( sense, 'v' ) ) {
LAPACKE_free( iwork );
}
exit_level_1:
if( LAPACKE_lsame( sense, 'b' ) || LAPACKE_lsame( sense, 'e' ) ||
LAPACKE_lsame( sense, 'v' ) ) {
LAPACKE_free( bwork );
//.........这里部分代码省略.........
示例15: LAPACKE_zggsvd3
lapack_int LAPACKE_zggsvd3( int matrix_layout, char jobu, char jobv, char jobq,
lapack_int m, lapack_int n, lapack_int p,
lapack_int* k, lapack_int* l,
lapack_complex_double* a, lapack_int lda,
lapack_complex_double* b, lapack_int ldb,
double* alpha, double* beta,
lapack_complex_double* u, lapack_int ldu,
lapack_complex_double* v, lapack_int ldv,
lapack_complex_double* q, lapack_int ldq,
lapack_int* iwork )
{
lapack_int info = 0;
double* rwork = NULL;
lapack_int lwork = -1;
lapack_complex_double* work = NULL;
lapack_complex_double work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_zggsvd3", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_zge_nancheck( matrix_layout, m, n, a, lda ) ) {
return -10;
}
if( LAPACKE_zge_nancheck( matrix_layout, p, n, b, ldb ) ) {
return -12;
}
#endif
/* Query optimal size for working array */
info = LAPACKE_zggsvd3_work( matrix_layout, jobu, jobv, jobq, m, n, p, k, l,
a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q,
ldq, &work_query, lwork, rwork, iwork );
if( info != 0 )
goto exit_level_0;
lwork = LAPACK_Z2INT( work_query );
/* Allocate memory for working array(s) */
rwork = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,2*n) );
if( rwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
work = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_zggsvd3_work( matrix_layout, jobu, jobv, jobq, m, n, p, k, l,
a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q,
ldq, work, lwork, rwork, iwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_1:
LAPACKE_free( rwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_zggsvd3", info );
}
return info;
}