本文整理汇总了C++中LAPACKE_sge_nancheck函数的典型用法代码示例。如果您正苦于以下问题:C++ LAPACKE_sge_nancheck函数的具体用法?C++ LAPACKE_sge_nancheck怎么用?C++ LAPACKE_sge_nancheck使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LAPACKE_sge_nancheck函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LAPACKE_strsyl
lapack_int LAPACKE_strsyl( int matrix_layout, char trana, char tranb,
lapack_int isgn, lapack_int m, lapack_int n,
const float* a, lapack_int lda, const float* b,
lapack_int ldb, float* c, lapack_int ldc,
float* scale )
{
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_strsyl", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_sge_nancheck( matrix_layout, m, m, a, lda ) ) {
return -7;
}
if( LAPACKE_sge_nancheck( matrix_layout, n, n, b, ldb ) ) {
return -9;
}
if( LAPACKE_sge_nancheck( matrix_layout, m, n, c, ldc ) ) {
return -11;
}
#endif
return LAPACKE_strsyl_work( matrix_layout, trana, tranb, isgn, m, n, a, lda,
b, ldb, c, ldc, scale );
}
示例2: LAPACKE_sgghrd
lapack_int LAPACKE_sgghrd( int matrix_order, char compq, char compz,
lapack_int n, lapack_int ilo, lapack_int ihi,
float* a, lapack_int lda, float* b, lapack_int ldb,
float* q, lapack_int ldq, float* z, lapack_int ldz )
{
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_sgghrd", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_sge_nancheck( matrix_order, n, n, a, lda ) ) {
return -7;
}
if( LAPACKE_sge_nancheck( matrix_order, n, n, b, ldb ) ) {
return -9;
}
if( LAPACKE_lsame( compq, 'i' ) || LAPACKE_lsame( compq, 'v' ) ) {
if( LAPACKE_sge_nancheck( matrix_order, n, n, q, ldq ) ) {
return -11;
}
}
if( LAPACKE_lsame( compz, 'i' ) || LAPACKE_lsame( compz, 'v' ) ) {
if( LAPACKE_sge_nancheck( matrix_order, n, n, z, ldz ) ) {
return -13;
}
}
#endif
return LAPACKE_sgghrd_work( matrix_order, compq, compz, n, ilo, ihi, a, lda,
b, ldb, q, ldq, z, ldz );
}
示例3: LAPACKE_sgghd3
lapack_int LAPACKE_sgghd3( int matrix_layout, char compq, char compz,
lapack_int n, lapack_int ilo, lapack_int ihi,
float* a, lapack_int lda, float* b, lapack_int ldb,
float* q, lapack_int ldq, float* z, lapack_int ldz )
{
lapack_int info = 0;
lapack_int lwork = -1;
float* work = NULL;
float work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_sgghd3", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_sge_nancheck( matrix_layout, n, n, a, lda ) ) {
return -7;
}
if( LAPACKE_sge_nancheck( matrix_layout, n, n, b, ldb ) ) {
return -9;
}
if( LAPACKE_lsame( compq, 'i' ) || LAPACKE_lsame( compq, 'v' ) ) {
if( LAPACKE_sge_nancheck( matrix_layout, n, n, q, ldq ) ) {
return -11;
}
}
if( LAPACKE_lsame( compz, 'i' ) || LAPACKE_lsame( compz, 'v' ) ) {
if( LAPACKE_sge_nancheck( matrix_layout, n, n, z, ldz ) ) {
return -13;
}
}
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_sgghd3_work( matrix_layout, compq, compz, n, ilo, ihi,
a, lda, b, ldb, q, ldq, z, ldz, &work_query,
lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = (lapack_int)work_query;
/* Allocate memory for work arrays */
work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_sgghd3_work( matrix_layout, compq, compz, n, ilo, ihi,
a, lda, b, ldb, q, ldq, z, ldz, work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_sgghd3", info );
}
return info;
}
示例4: LAPACKE_stprfb
lapack_int LAPACKE_stprfb( int matrix_layout, char side, char trans, char direct,
char storev, lapack_int m, lapack_int n,
lapack_int k, lapack_int l, const float* v,
lapack_int ldv, const float* t, lapack_int ldt,
float* a, lapack_int lda, float* b, lapack_int ldb)
{
lapack_int info = 0;
lapack_int ldwork;
lapack_int work_size;
float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_stprfb", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_sge_nancheck( matrix_layout, k, m, a, lda ) ) {
return -14;
}
if( LAPACKE_sge_nancheck( matrix_layout, m, n, b, ldb ) ) {
return -16;
}
if( LAPACKE_sge_nancheck( matrix_layout, ldt, k, t, ldt ) ) {
return -12;
}
if( LAPACKE_sge_nancheck( matrix_layout, ldv, k, v, ldv ) ) {
return -10;
}
#endif
if (side=='l' || side=='L') {
ldwork = k;
work_size = MAX(1,ldwork) * MAX(1,n);
}
else {
ldwork = m;
work_size = MAX(1,ldwork) * MAX(1,k);
}
/* Allocate memory for working array(s) */
work = (float*)
LAPACKE_malloc( sizeof(float) * work_size );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_stprfb_work( matrix_layout, side, trans, direct, storev, m, n,
k, l, v, ldv, t, ldt, a, lda, b, ldb, work,
ldwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_stprfb", info );
}
return info;
}
示例5: LAPACKE_spbrfs
lapack_int LAPACKE_spbrfs( int matrix_layout, char uplo, lapack_int n,
lapack_int kd, lapack_int nrhs, const float* ab,
lapack_int ldab, const float* afb, lapack_int ldafb,
const float* b, lapack_int ldb, float* x,
lapack_int ldx, float* ferr, float* berr )
{
lapack_int info = 0;
lapack_int* iwork = NULL;
float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_spbrfs", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_spb_nancheck( matrix_layout, uplo, n, kd, ab, ldab ) ) {
return -6;
}
if( LAPACKE_spb_nancheck( matrix_layout, uplo, n, kd, afb, ldafb ) ) {
return -8;
}
if( LAPACKE_sge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
return -10;
}
if( LAPACKE_sge_nancheck( matrix_layout, n, nrhs, x, ldx ) ) {
return -12;
}
}
#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 = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,3*n) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_spbrfs_work( matrix_layout, uplo, n, kd, nrhs, ab, ldab, afb,
ldafb, 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_spbrfs", info );
}
return info;
}
示例6: LAPACKE_sormbr
lapack_int LAPACKE_sormbr( int matrix_layout, char vect, char side, char trans,
lapack_int m, lapack_int n, lapack_int k,
const float* a, lapack_int lda, const float* tau,
float* c, lapack_int ldc )
{
lapack_int info = 0;
lapack_int lwork = -1;
float* work = NULL;
float work_query;
lapack_int nq, ar, ac;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_sormbr", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* 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_sge_nancheck( matrix_layout, ar, ac, a, lda ) ) {
return -8;
}
if( LAPACKE_sge_nancheck( matrix_layout, m, n, c, ldc ) ) {
return -11;
}
if( LAPACKE_s_nancheck( MIN(nq,k), tau, 1 ) ) {
return -10;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_sormbr_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 = (float*)LAPACKE_malloc( sizeof(float) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_sormbr_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_sormbr", info );
}
return info;
}
示例7: LAPACKE_sbdsqr
lapack_int LAPACKE_sbdsqr( int matrix_layout, char uplo, lapack_int n,
lapack_int ncvt, lapack_int nru, lapack_int ncc,
float* d, float* e, float* vt, lapack_int ldvt,
float* u, lapack_int ldu, float* c, lapack_int ldc )
{
lapack_int info = 0;
float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_sbdsqr", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( ncc != 0 ) {
if( LAPACKE_sge_nancheck( matrix_layout, n, ncc, c, ldc ) ) {
return -13;
}
}
if( LAPACKE_s_nancheck( n, d, 1 ) ) {
return -7;
}
if( LAPACKE_s_nancheck( n-1, e, 1 ) ) {
return -8;
}
if( nru != 0 ) {
if( LAPACKE_sge_nancheck( matrix_layout, nru, n, u, ldu ) ) {
return -11;
}
}
if( ncvt != 0 ) {
if( LAPACKE_sge_nancheck( matrix_layout, n, ncvt, vt, ldvt ) ) {
return -9;
}
}
#endif
/* Allocate memory for working array(s) */
work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,4*n) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_sbdsqr_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_sbdsqr", info );
}
return info;
}
示例8: LAPACKE_stgevc
lapack_int LAPACKE_stgevc( int matrix_layout, char side, char howmny,
const lapack_logical* select, lapack_int n,
const float* s, lapack_int lds, const float* p,
lapack_int ldp, float* vl, lapack_int ldvl,
float* vr, lapack_int ldvr, lapack_int mm,
lapack_int* m )
{
lapack_int info = 0;
float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_stgevc", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
if( LAPACKE_get_nancheck() ) {
/* Optionally check input matrices for NaNs */
if( LAPACKE_sge_nancheck( matrix_layout, n, n, p, ldp ) ) {
return -8;
}
if( LAPACKE_sge_nancheck( matrix_layout, n, n, s, lds ) ) {
return -6;
}
if( LAPACKE_lsame( side, 'b' ) || LAPACKE_lsame( side, 'l' ) ) {
if( LAPACKE_sge_nancheck( matrix_layout, n, mm, vl, ldvl ) ) {
return -10;
}
}
if( LAPACKE_lsame( side, 'b' ) || LAPACKE_lsame( side, 'r' ) ) {
if( LAPACKE_sge_nancheck( matrix_layout, n, mm, vr, ldvr ) ) {
return -12;
}
}
}
#endif
/* Allocate memory for working array(s) */
work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,6*n) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_stgevc_work( matrix_layout, side, howmny, select, n, s, lds,
p, ldp, vl, ldvl, vr, ldvr, mm, m, work );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_stgevc", info );
}
return info;
}
示例9: LAPACKE_sgglse
lapack_int LAPACKE_sgglse( int matrix_layout, lapack_int m, lapack_int n,
lapack_int p, float* a, lapack_int lda, float* b,
lapack_int ldb, float* c, float* d, float* x )
{
lapack_int info = 0;
lapack_int lwork = -1;
float* work = NULL;
float work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_sgglse", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_sge_nancheck( matrix_layout, m, n, a, lda ) ) {
return -5;
}
if( LAPACKE_sge_nancheck( matrix_layout, p, n, b, ldb ) ) {
return -7;
}
if( LAPACKE_s_nancheck( m, c, 1 ) ) {
return -9;
}
if( LAPACKE_s_nancheck( p, d, 1 ) ) {
return -10;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_sgglse_work( matrix_layout, 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 = (float*)LAPACKE_malloc( sizeof(float) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_sgglse_work( matrix_layout, 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_sgglse", info );
}
return info;
}
示例10: LAPACKE_sggbal
lapack_int LAPACKE_sggbal( int matrix_layout, char job, lapack_int n, float* a,
lapack_int lda, float* b, lapack_int ldb,
lapack_int* ilo, lapack_int* ihi, float* lscale,
float* rscale )
{
lapack_int info = 0;
/* Additional scalars declarations for work arrays */
lapack_int lwork;
float* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_sggbal", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_lsame( job, 'p' ) || LAPACKE_lsame( job, 's' ) ||
LAPACKE_lsame( job, 'b' ) ) {
if( LAPACKE_sge_nancheck( matrix_layout, n, n, a, lda ) ) {
return -4;
}
}
if( LAPACKE_lsame( job, 'p' ) || LAPACKE_lsame( job, 's' ) ||
LAPACKE_lsame( job, 'b' ) ) {
if( LAPACKE_sge_nancheck( matrix_layout, n, n, b, ldb ) ) {
return -6;
}
}
#endif
/* Additional scalars initializations for work arrays */
if( LAPACKE_lsame( job, 's' ) || LAPACKE_lsame( job, 'b' ) ) {
lwork = MAX(1,6*n);
} else {
lwork = 1;
}
/* Allocate memory for working array(s) */
work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_sggbal_work( matrix_layout, job, n, a, lda, b, ldb, ilo, ihi,
lscale, rscale, work );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_sggbal", info );
}
return info;
}
示例11: LAPACKE_strrfs
lapack_int LAPACKE_strrfs( int matrix_order, char uplo, char trans, char diag,
lapack_int n, lapack_int nrhs, const float* a,
lapack_int lda, const float* b, lapack_int ldb,
const float* x, lapack_int ldx, float* ferr,
float* berr )
{
lapack_int info = 0;
lapack_int* iwork = NULL;
float* work = NULL;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_strrfs", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_str_nancheck( matrix_order, uplo, diag, n, a, lda ) ) {
return -7;
}
if( LAPACKE_sge_nancheck( matrix_order, n, nrhs, b, ldb ) ) {
return -9;
}
if( LAPACKE_sge_nancheck( matrix_order, n, nrhs, x, ldx ) ) {
return -11;
}
#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 = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,3*n) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_1;
}
/* Call middle-level interface */
info = LAPACKE_strrfs_work( matrix_order, uplo, trans, diag, n, nrhs, a,
lda, 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_strrfs", info );
}
return info;
}
示例12: LAPACKE_sggev
lapack_int LAPACKE_sggev( int matrix_layout, char jobvl, char jobvr,
lapack_int n, float* a, lapack_int lda, float* b,
lapack_int ldb, float* alphar, float* alphai,
float* beta, float* vl, lapack_int ldvl, float* vr,
lapack_int ldvr )
{
lapack_int info = 0;
lapack_int lwork = -1;
float* work = NULL;
float work_query;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_sggev", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_sge_nancheck( matrix_layout, n, n, a, lda ) ) {
return -5;
}
if( LAPACKE_sge_nancheck( matrix_layout, n, n, b, ldb ) ) {
return -7;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_sggev_work( matrix_layout, jobvl, jobvr, n, a, lda, b, ldb,
alphar, alphai, beta, vl, ldvl, vr, ldvr,
&work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = (lapack_int)work_query;
/* Allocate memory for work arrays */
work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_sggev_work( matrix_layout, jobvl, jobvr, n, a, lda, b, ldb,
alphar, alphai, beta, vl, ldvl, vr, ldvr, work,
lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_sggev", info );
}
return info;
}
示例13: LAPACKE_sgelsy
lapack_int LAPACKE_sgelsy( int matrix_order, lapack_int m, lapack_int n,
lapack_int nrhs, float* a, lapack_int lda, float* b,
lapack_int ldb, lapack_int* jpvt, float rcond,
lapack_int* rank )
{
lapack_int info = 0;
lapack_int lwork = -1;
float* work = NULL;
float work_query;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_sgelsy", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_sge_nancheck( matrix_order, m, n, a, lda ) ) {
return -5;
}
if( LAPACKE_sge_nancheck( matrix_order, MAX(m,n), nrhs, b, ldb ) ) {
return -7;
}
if( LAPACKE_s_nancheck( 1, &rcond, 1 ) ) {
return -10;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_sgelsy_work( matrix_order, m, n, nrhs, a, lda, b, ldb, jpvt,
rcond, rank, &work_query, lwork );
if( info != 0 ) {
goto exit_level_0;
}
lwork = (lapack_int)work_query;
/* Allocate memory for work arrays */
work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_sgelsy_work( matrix_order, m, n, nrhs, a, lda, b, ldb, jpvt,
rcond, rank, work, lwork );
/* Release memory and exit */
LAPACKE_free( work );
exit_level_0:
if( info == LAPACK_WORK_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_sgelsy", info );
}
return info;
}
示例14: LAPACKE_sgesvj
lapack_int LAPACKE_sgesvj( int matrix_layout, char joba, char jobu, char jobv,
lapack_int m, lapack_int n, float* a, lapack_int lda,
float* sva, lapack_int mv, float* v, lapack_int ldv,
float* stat )
{
lapack_int info = 0;
lapack_int lwork = MAX(6,m+n);
float* work = NULL;
lapack_int i;
lapack_int nrows_v;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_sgesvj", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
nrows_v = LAPACKE_lsame( jobv, 'v' ) ? MAX(0,n) :
( LAPACKE_lsame( jobv, 'a' ) ? MAX(0,mv) : 0 );
if( LAPACKE_sge_nancheck( matrix_layout, m, n, a, lda ) ) {
return -7;
}
if( LAPACKE_lsame( jobv, 'a' ) || LAPACKE_lsame( jobv, 'v' ) ) {
if( LAPACKE_sge_nancheck( matrix_layout, nrows_v, n, v, ldv ) ) {
return -11;
}
}
#endif
/* Allocate memory for working array(s) */
work = (float*)LAPACKE_malloc( sizeof(float) * 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_sgesvj_work( matrix_layout, 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_sgesvj", info );
}
return info;
}
示例15: LAPACKE_sormlq
lapack_int LAPACKE_sormlq( int matrix_order, char side, char trans,
lapack_int m, lapack_int n, lapack_int k,
const float* a, lapack_int lda, const float* tau,
float* c, lapack_int ldc )
{
lapack_int info = 0;
lapack_int lwork = -1;
float* work = NULL;
float work_query;
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_sormlq", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_sge_nancheck( matrix_order, k, m, a, lda ) ) {
return -7;
}
if( LAPACKE_sge_nancheck( matrix_order, m, n, c, ldc ) ) {
return -10;
}
if( LAPACKE_s_nancheck( k, tau, 1 ) ) {
return -9;
}
#endif
/* Query optimal working array(s) size */
info = LAPACKE_sormlq_work( matrix_order, 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 = (float*)LAPACKE_malloc( sizeof(float) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
}
/* Call middle-level interface */
info = LAPACKE_sormlq_work( matrix_order, 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_sormlq", info );
}
return info;
}