本文整理汇总了C++中LAPACKE_dge_nancheck函数的典型用法代码示例。如果您正苦于以下问题:C++ LAPACKE_dge_nancheck函数的具体用法?C++ LAPACKE_dge_nancheck怎么用?C++ LAPACKE_dge_nancheck使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LAPACKE_dge_nancheck函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LAPACKE_dtrsyl
lapack_int LAPACKE_dtrsyl( int matrix_order, char trana, char tranb,
lapack_int isgn, lapack_int m, lapack_int n,
const double* a, lapack_int lda, const double* b,
lapack_int ldb, double* c, lapack_int ldc,
double* scale )
{
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dtrsyl", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_dge_nancheck( matrix_order, m, m, a, lda ) ) {
return -7;
}
if( LAPACKE_dge_nancheck( matrix_order, n, n, b, ldb ) ) {
return -9;
}
if( LAPACKE_dge_nancheck( matrix_order, m, n, c, ldc ) ) {
return -11;
}
#endif
return LAPACKE_dtrsyl_work( matrix_order, trana, tranb, isgn, m, n, a, lda,
b, ldb, c, ldc, scale );
}
示例2: LAPACKE_dtpmqrt
lapack_int LAPACKE_dtpmqrt( int matrix_layout, char side, char trans,
lapack_int m, lapack_int n, lapack_int k,
lapack_int l, lapack_int nb, const double* v,
lapack_int ldv, const double* t, lapack_int ldt,
double* a, lapack_int lda, double* b,
lapack_int ldb )
{
lapack_int ncols_a, nrows_a;
lapack_int nrows_v;
lapack_int lwork;
lapack_int info = 0;
double* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dtpmqrt", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
ncols_a = LAPACKE_lsame( side, 'L' ) ? n :
( LAPACKE_lsame( side, 'R' ) ? k : 0 );
nrows_a = LAPACKE_lsame( side, 'L' ) ? k :
( LAPACKE_lsame( side, 'R' ) ? m : 0 );
nrows_v = LAPACKE_lsame( side, 'L' ) ? m :
( LAPACKE_lsame( side, 'R' ) ? n : 0 );
if( LAPACKE_dge_nancheck( matrix_layout, nrows_a, ncols_a, a, lda ) ) {
return -13;
}
if( LAPACKE_dge_nancheck( matrix_layout, m, n, b, ldb ) ) {
return -15;
}
if( LAPACKE_dge_nancheck( matrix_layout, nb, k, t, ldt ) ) {
return -11;
}
if( LAPACKE_dge_nancheck( matrix_layout, nrows_v, k, v, ldv ) ) {
return -9;
}
}
#endif
/* Allocate memory for working array(s) */
lwork = LAPACKE_lsame( side, 'L' ) ? MAX(1,nb) * MAX(1,n) :
( LAPACKE_lsame( side, 'R' ) ? MAX(1,m) * MAX(1,nb) : 0 );
work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_dtpmqrt_work( matrix_layout, side, trans, m, n, k, l, nb, v,
ldv, t, ldt, a, lda, b, ldb, work );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dtpmqrt", info );
}
return info;
}
示例3: LAPACKE_dsygvd
lapack_int LAPACKE_dsygvd( int matrix_layout, lapack_int itype, char jobz,
char uplo, lapack_int n, double* a, lapack_int lda,
double* b, lapack_int ldb, double* w )
{
lapack_int info = 0;
lapack_int liwork = -1;
lapack_int lwork = -1;
lapack_int* iwork = NULL;
double* work = NULL;
lapack_int iwork_query;
double work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dsygvd", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_dge_nancheck( matrix_layout, n, n, a, lda ) ) {
return -6;
}
if( LAPACKE_dge_nancheck( matrix_layout, n, n, b, ldb ) ) {
return -8;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_dsygvd_work( matrix_layout, itype, jobz, uplo, n, a, lda, b,
ldb, w, &work_query, lwork, &iwork_query,
liwork );
if( info != 0 ) {
goto exit_level_0;
}
liwork = (lapack_int)iwork_query;
lwork = (lapack_int)work_query;
/* Allocate memory for work arrays */
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
if( iwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_dsygvd_work( matrix_layout, itype, jobz, uplo, n, a, lda, b,
ldb, w, work, lwork, iwork, liwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_1:
LAPACKE_free( iwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dsygvd", info );
}
return info;
}
示例4: LAPACKE_dormbr
lapack_int LAPACKE_dormbr( int matrix_layout, char vect, char side, char trans,
lapack_int m, lapack_int n, lapack_int k,
const double* a, lapack_int lda, const double* tau,
double* c, lapack_int ldc )
{
lapack_int info = 0;
lapack_int lwork = -1;
double* work = NULL;
double work_query;
lapack_int nq, ar, ac;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dormbr", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
nq = LAPACKE_lsame( side, 'l' ) ? m : n;
ar = LAPACKE_lsame( vect, 'q' ) ? nq : MIN(nq,k);
ac = LAPACKE_lsame( vect, 'q' ) ? MIN(nq,k) : nq;
if( LAPACKE_dge_nancheck( matrix_layout, ar, ac, a, lda ) ) {
return -8;
}
if( LAPACKE_dge_nancheck( matrix_layout, m, n, c, ldc ) ) {
return -11;
}
if( LAPACKE_d_nancheck( MIN(nq,k), tau, 1 ) ) {
return -10;
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_dormbr_work( matrix_layout, vect, side, trans, m, n, k, a,
lda, tau, c, ldc, &work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = (lapack_int)work_query;
/* Allocate memory for work arrays */
work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_dormbr_work( matrix_layout, vect, side, trans, m, n, k, 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_dormbr", info );
}
return info;
}
示例5: LAPACKE_dgbrfs
lapack_int LAPACKE_dgbrfs( int matrix_layout, char trans, lapack_int n,
lapack_int kl, lapack_int ku, lapack_int nrhs,
const double* ab, lapack_int ldab, const double* afb,
lapack_int ldafb, const lapack_int* ipiv,
const double* b, lapack_int ldb, double* x,
lapack_int ldx, double* ferr, double* berr )
{
lapack_int info = 0;
lapack_int* iwork = NULL;
double* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dgbrfs", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_dgb_nancheck( matrix_layout, n, n, kl, ku, ab, ldab ) ) {
return -7;
}
if( LAPACKE_dgb_nancheck( matrix_layout, n, n, kl, kl+ku, afb, ldafb ) ) {
return -9;
}
if( LAPACKE_dge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
return -12;
}
if( LAPACKE_dge_nancheck( matrix_layout, n, nrhs, x, ldx ) ) {
return -14;
}
#endif
/* Allocate memory for working array(s) */
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,n) );
if( iwork == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,3*n) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_dgbrfs_work( matrix_layout, trans, n, kl, ku, nrhs, ab, ldab,
afb, ldafb, ipiv, b, ldb, x, ldx, ferr, berr,
work, iwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_1:
LAPACKE_free( iwork );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dgbrfs", info );
}
return info;
}
示例6: LAPACKE_dbdsqr
lapack_int LAPACKE_dbdsqr( int matrix_layout, char uplo, lapack_int n,
lapack_int ncvt, lapack_int nru, lapack_int ncc,
double* d, double* e, double* vt, lapack_int ldvt,
double* u, lapack_int ldu, double* c,
lapack_int ldc )
{
lapack_int info = 0;
double* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dbdsqr", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( ncc != 0 ) {
if( LAPACKE_dge_nancheck( matrix_layout, n, ncc, c, ldc ) ) {
return -13;
}
}
if( LAPACKE_d_nancheck( n, d, 1 ) ) {
return -7;
}
if( LAPACKE_d_nancheck( n-1, e, 1 ) ) {
return -8;
}
if( nru != 0 ) {
if( LAPACKE_dge_nancheck( matrix_layout, nru, n, u, ldu ) ) {
return -11;
}
}
if( ncvt != 0 ) {
if( LAPACKE_dge_nancheck( matrix_layout, n, ncvt, vt, ldvt ) ) {
return -9;
}
}
#endif
/* Allocate memory for working array(s) */
work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,4*n) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_dbdsqr_work( matrix_layout, uplo, n, ncvt, nru, ncc, d, e, vt,
ldvt, u, ldu, c, ldc, work );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dbdsqr", info );
}
return info;
}
示例7: LAPACKE_dgemlq
lapack_int LAPACKE_dgemlq( int matrix_layout, char side, char trans,
lapack_int m, lapack_int n, lapack_int k,
const double* a, lapack_int lda,
const double* t, lapack_int tsize,
double* c, lapack_int ldc )
{
lapack_int info = 0;
lapack_int lwork = -1;
double* work = NULL;
double work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dgemlq", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_dge_nancheck( matrix_layout, k, m, a, lda ) ) {
return -7;
}
if( LAPACKE_dge_nancheck( matrix_layout, m, n, c, ldc ) ) {
return -10;
}
if( LAPACKE_d_nancheck( tsize, t, 1 ) ) {
return -9;
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_dgemlq_work( matrix_layout, side, trans, m, n, k, a, lda,
t, tsize, c, ldc, &work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = (lapack_int)work_query;
/* Allocate memory for work arrays */
work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_dgemlq_work( matrix_layout, side, trans, m, n, k, a, lda,
t, tsize, c, ldc, work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dgemlq", info );
}
return info;
}
示例8: LAPACKE_dgglse
lapack_int LAPACKE_dgglse( int matrix_order, lapack_int m, lapack_int n,
lapack_int p, double* a, lapack_int lda, double* b,
lapack_int ldb, double* c, double* d, double* x )
{
lapack_int info = 0;
lapack_int lwork = -1;
double* work = NULL;
double work_query;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dgglse", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_dge_nancheck( matrix_order, m, n, a, lda ) ) {
return -5;
}
if( LAPACKE_dge_nancheck( matrix_order, p, n, b, ldb ) ) {
return -7;
}
if( LAPACKE_d_nancheck( m, c, 1 ) ) {
return -9;
}
if( LAPACKE_d_nancheck( p, d, 1 ) ) {
return -10;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_dgglse_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_int)work_query;
/* Allocate memory for work arrays */
work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_dgglse_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_dgglse", info );
}
return info;
}
示例9: LAPACKE_dptrfs
lapack_int LAPACKE_dptrfs( int matrix_order, lapack_int n, lapack_int nrhs,
const double* d, const double* e, const double* df,
const double* ef, const double* b, lapack_int ldb,
double* x, lapack_int ldx, double* ferr,
double* berr )
{
lapack_int info = 0;
double* work = NULL;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dptrfs", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_dge_nancheck( matrix_order, n, nrhs, b, ldb ) ) {
return -8;
}
if( LAPACKE_d_nancheck( n, d, 1 ) ) {
return -4;
}
if( LAPACKE_d_nancheck( n, df, 1 ) ) {
return -6;
}
if( LAPACKE_d_nancheck( n-1, e, 1 ) ) {
return -5;
}
if( LAPACKE_d_nancheck( n-1, ef, 1 ) ) {
return -7;
}
if( LAPACKE_dge_nancheck( matrix_order, n, nrhs, x, ldx ) ) {
return -10;
}
#endif
/* Allocate memory for working array(s) */
work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,2*n) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_dptrfs_work( matrix_order, n, nrhs, d, e, df, ef, b, ldb, x,
ldx, ferr, berr, work );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dptrfs", info );
}
return info;
}
示例10: LAPACKE_dgelss
lapack_int LAPACKE_dgelss( int matrix_layout, lapack_int m, lapack_int n,
lapack_int nrhs, double* a, lapack_int lda,
double* b, lapack_int ldb, double* s, double rcond,
lapack_int* rank )
{
lapack_int info = 0;
lapack_int lwork = -1;
double* work = NULL;
double work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dgelss", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_dge_nancheck( matrix_layout, m, n, a, lda ) ) {
return -5;
}
if( LAPACKE_dge_nancheck( matrix_layout, MAX(m,n), nrhs, b, ldb ) ) {
return -7;
}
if( LAPACKE_d_nancheck( 1, &rcond, 1 ) ) {
return -10;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_dgelss_work( matrix_layout, m, n, nrhs, a, lda, b, ldb, s,
rcond, rank, &work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = (lapack_int)work_query;
/* Allocate memory for work arrays */
work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_dgelss_work( matrix_layout, m, n, nrhs, a, lda, b, ldb, s,
rcond, rank, work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dgelss", info );
}
return info;
}
示例11: LAPACKE_dgesvj
lapack_int LAPACKE_dgesvj( int matrix_order, char joba, char jobu, char jobv,
lapack_int m, lapack_int n, double* a,
lapack_int lda, double* sva, lapack_int mv,
double* v, lapack_int ldv, double* stat )
{
lapack_int info = 0;
lapack_int lwork = MAX(6,m+n);
double* work = NULL;
lapack_int i;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dgesvj", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
lapack_int nrows_v = LAPACKE_lsame( jobv, 'v' ) ? n :
( LAPACKE_lsame( jobv, 'a' ) ? mv : 1);
if( LAPACKE_dge_nancheck( matrix_order, m, n, a, lda ) ) {
return -7;
}
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 'v' ) ) {
if( LAPACKE_dge_nancheck( matrix_order, nrows_v, n, v, ldv ) ) {
return -11;
}
}
#endif
/* Allocate memory for working array(s) */
work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
work[0] = stat[0]; /* Significant if jobu = 'c' */
/* Call middle-level interface */
info = LAPACKE_dgesvj_work( matrix_order, joba, jobu, jobv, m, n, a, lda,
sva, mv, v, ldv, work, lwork );
/* Backup significant data from working array(s) */
for( i=0; i<6; i++ ) {
stat[i] = work[i];
}
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dgesvj", info );
}
return info;
}
示例12: LAPACKE_dgg_nancheck
lapack_logical LAPACKE_dgg_nancheck( int matrix_order, lapack_int m,
lapack_int n,
const double *a,
lapack_int lda )
{
return LAPACKE_dge_nancheck( matrix_order, m, n, a, lda );
}
示例13: LAPACKE_dlarft
lapack_int LAPACKE_dlarft( int matrix_order, char direct, char storev,
lapack_int n, lapack_int k, const double* v,
lapack_int ldv, const double* tau, double* t,
lapack_int ldt )
{
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dlarft", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
lapack_int ncols_v = LAPACKE_lsame( storev, 'c' ) ? k :
( LAPACKE_lsame( storev, 'r' ) ? n : 1);
lapack_int nrows_v = LAPACKE_lsame( storev, 'c' ) ? n :
( LAPACKE_lsame( storev, 'r' ) ? k : 1);
if( LAPACKE_d_nancheck( k, tau, 1 ) ) {
return -8;
}
if( LAPACKE_dge_nancheck( matrix_order, nrows_v, ncols_v, v, ldv ) ) {
return -6;
}
#endif
return LAPACKE_dlarft_work( matrix_order, direct, storev, n, k, v, ldv, tau,
t, ldt );
}
示例14: LAPACKE_dgelq2
lapack_int LAPACKE_dgelq2( int matrix_layout, lapack_int m, lapack_int n,
double* a, lapack_int lda, double* tau )
{
lapack_int info = 0;
double* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dgelq2", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_dge_nancheck( matrix_layout, m, n, a, lda ) ) {
return -4;
}
}
#endif
/* Allocate memory for working array(s) */
work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,m) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_dgelq2_work( matrix_layout, m, n, a, lda, tau, work );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dgelq2", info );
}
return info;
}
示例15: LAPACKE_dsfrk
lapack_int LAPACKE_dsfrk( int matrix_layout, char transr, char uplo, char trans,
lapack_int n, lapack_int k, double alpha,
const double* a, lapack_int lda, double beta,
double* c )
{
lapack_int ka, na;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_dsfrk", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
ka = LAPACKE_lsame( trans, 'n' ) ? k : n;
na = LAPACKE_lsame( trans, 'n' ) ? n : k;
if( LAPACKE_dge_nancheck( matrix_layout, na, ka, a, lda ) ) {
return -8;
}
if( LAPACKE_d_nancheck( 1, &alpha, 1 ) ) {
return -7;
}
if( LAPACKE_d_nancheck( 1, &beta, 1 ) ) {
return -10;
}
if( LAPACKE_dpf_nancheck( n, c ) ) {
return -11;
}
#endif
return LAPACKE_dsfrk_work( matrix_layout, transr, uplo, trans, n, k, alpha,
a, lda, beta, c );
}