本文整理汇总了C++中LAPACKE_sge_trans函数的典型用法代码示例。如果您正苦于以下问题:C++ LAPACKE_sge_trans函数的具体用法?C++ LAPACKE_sge_trans怎么用?C++ LAPACKE_sge_trans使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LAPACKE_sge_trans函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LAPACKE_sgebal_work
lapack_int LAPACKE_sgebal_work( int matrix_order, char job, lapack_int n,
float* a, lapack_int lda, lapack_int* ilo,
lapack_int* ihi, float* scale )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_sgebal( &job, &n, a, &lda, ilo, ihi, scale, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,n);
float* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -5;
LAPACKE_xerbla( "LAPACKE_sgebal_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
LAPACKE_lsame( job, 's' ) ) {
a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
}
/* Transpose input matrices */
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
LAPACKE_lsame( job, 's' ) ) {
LAPACKE_sge_trans( matrix_order, n, n, a, lda, a_t, lda_t );
}
/* Call LAPACK function and adjust info */
LAPACK_sgebal( &job, &n, a_t, &lda_t, ilo, ihi, scale, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
LAPACKE_lsame( job, 's' ) ) {
LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
}
/* Release memory and exit */
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
LAPACKE_lsame( job, 's' ) ) {
LAPACKE_free( a_t );
}
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_sgebal_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_sgebal_work", info );
}
return info;
}
示例2: LAPACKE_stptrs_work
lapack_int LAPACKE_stptrs_work( int matrix_order, char uplo, char trans,
char diag, lapack_int n, lapack_int nrhs,
const float* ap, float* b, lapack_int ldb )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_stptrs( &uplo, &trans, &diag, &n, &nrhs, ap, b, &ldb, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int ldb_t = MAX(1,n);
float* b_t = NULL;
float* ap_t = NULL;
/* Check leading dimension(s) */
if( ldb < nrhs ) {
info = -9;
LAPACKE_xerbla( "LAPACKE_stptrs_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
b_t = (float*)LAPACKE_malloc( sizeof(float) * ldb_t * MAX(1,nrhs) );
if( b_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
ap_t = (float*)
LAPACKE_malloc( sizeof(float) * ( MAX(1,n) * MAX(2,n+1) ) / 2 );
if( ap_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_1;
}
/* Transpose input matrices */
LAPACKE_sge_trans( matrix_order, n, nrhs, b, ldb, b_t, ldb_t );
LAPACKE_stp_trans( matrix_order, uplo, diag, n, ap, ap_t );
/* Call LAPACK function and adjust info */
LAPACK_stptrs( &uplo, &trans, &diag, &n, &nrhs, ap_t, b_t, &ldb_t,
&info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
/* Release memory and exit */
LAPACKE_free( ap_t );
exit_level_1:
LAPACKE_free( b_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_stptrs_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_stptrs_work", info );
}
return info;
}
示例3: LAPACKE_ssyevd_2stage_work
lapack_int LAPACKE_ssyevd_2stage_work( int matrix_layout, char jobz, char uplo,
lapack_int n, float* a, lapack_int lda,
float* w, float* work, lapack_int lwork,
lapack_int* iwork, lapack_int liwork )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_ssyevd_2stage( &jobz, &uplo, &n, a, &lda, w, work, &lwork, iwork,
&liwork, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,n);
float* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -6;
LAPACKE_xerbla( "LAPACKE_ssyevd_2stage_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
if( liwork == -1 || lwork == -1 ) {
LAPACK_ssyevd_2stage( &jobz, &uplo, &n, a, &lda_t, w, work, &lwork, iwork,
&liwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_sge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_ssyevd_2stage( &jobz, &uplo, &n, a_t, &lda_t, w, work, &lwork, iwork,
&liwork, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_ssyevd_2stage_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_ssyevd_2stage_work", info );
}
return info;
}
示例4: LAPACKE_sorgbr_work
lapack_int LAPACKE_sorgbr_work( int matrix_order, char vect, lapack_int m,
lapack_int n, lapack_int k, float* a,
lapack_int lda, const float* tau, float* work,
lapack_int lwork )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_sorgbr( &vect, &m, &n, &k, a, &lda, tau, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,m);
float* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_sorgbr_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_sorgbr( &vect, &m, &n, &k, a, &lda_t, tau, work, &lwork,
&info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_sge_trans( matrix_order, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_sorgbr( &vect, &m, &n, &k, a_t, &lda_t, tau, work, &lwork,
&info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_sge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_sorgbr_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_sorgbr_work", info );
}
return info;
}
示例5: LAPACKE_slatms_work
lapack_int LAPACKE_slatms_work( int matrix_order, lapack_int m, lapack_int n,
char dist, lapack_int* iseed, char sym,
float* d, lapack_int mode, float cond,
float dmax, lapack_int kl, lapack_int ku,
char pack, float* a, lapack_int lda,
float* work )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_slatms( &m, &n, &dist, iseed, &sym, d, &mode, &cond, &dmax, &kl,
&ku, &pack, a, &lda, work, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,m);
float* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -15;
LAPACKE_xerbla( "LAPACKE_slatms_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_sge_trans( matrix_order, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_slatms( &m, &n, &dist, iseed, &sym, d, &mode, &cond, &dmax, &kl,
&ku, &pack, a_t, &lda_t, work, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_sge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_slatms_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_slatms_work", info );
}
return info;
}
示例6: LAPACKE_sgebak_work
lapack_int LAPACKE_sgebak_work( int matrix_order, char job, char side,
lapack_int n, lapack_int ilo, lapack_int ihi,
const float* scale, lapack_int m, float* v,
lapack_int ldv )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_sgebak( &job, &side, &n, &ilo, &ihi, scale, &m, v, &ldv, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int ldv_t = MAX(1,n);
float* v_t = NULL;
/* Check leading dimension(s) */
if( ldv < m ) {
info = -10;
LAPACKE_xerbla( "LAPACKE_sgebak_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
v_t = (float*)LAPACKE_malloc( sizeof(float) * ldv_t * MAX(1,m) );
if( v_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_sge_trans( matrix_order, n, m, v, ldv, v_t, ldv_t );
/* Call LAPACK function and adjust info */
LAPACK_sgebak( &job, &side, &n, &ilo, &ihi, scale, &m, v_t, &ldv_t,
&info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, m, v_t, ldv_t, v, ldv );
/* Release memory and exit */
LAPACKE_free( v_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_sgebak_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_sgebak_work", info );
}
return info;
}
示例7: LAPACKE_spteqr_work
lapack_int LAPACKE_spteqr_work( int matrix_layout, char compz, lapack_int n,
float* d, float* e, float* z, lapack_int ldz,
float* work )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_spteqr( &compz, &n, d, e, z, &ldz, work, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int ldz_t = MAX(1,n);
float* z_t = NULL;
/* Check leading dimension(s) */
if( ldz < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_spteqr_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
z_t = (float*)LAPACKE_malloc( sizeof(float) * ldz_t * MAX(1,n) );
if( z_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
if( LAPACKE_lsame( compz, 'v' ) ) {
LAPACKE_sge_trans( matrix_layout, n, n, z, ldz, z_t, ldz_t );
}
/* Call LAPACK function and adjust info */
LAPACK_spteqr( &compz, &n, d, e, z_t, &ldz_t, work, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, n, z_t, ldz_t, z, ldz );
/* Release memory and exit */
LAPACKE_free( z_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_spteqr_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_spteqr_work", info );
}
return info;
}
示例8: LAPACKE_clacp2_work
lapack_int LAPACKE_clacp2_work( int matrix_layout, char uplo, lapack_int m,
lapack_int n, const float* a, lapack_int lda,
lapack_complex_float* b, lapack_int ldb )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_clacp2( &uplo, &m, &n, a, &lda, b, &ldb );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,m);
lapack_int ldb_t = MAX(1,m);
float* a_t = NULL;
lapack_complex_float* b_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -6;
LAPACKE_xerbla( "LAPACKE_clacp2_work", info );
return info;
}
if( ldb < n ) {
info = -8;
LAPACKE_xerbla( "LAPACKE_clacp2_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
b_t = (lapack_complex_float*)
LAPACKE_malloc( sizeof(lapack_complex_float) * ldb_t * MAX(1,n) );
if( b_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_1;
}
/* Transpose input matrices */
LAPACKE_sge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_clacp2( &uplo, &m, &n, a_t, &lda_t, b_t, &ldb_t );
info = 0; /* LAPACK call is ok! */
/* Transpose output matrices */
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, b_t, ldb_t, b, ldb );
/* Release memory and exit */
LAPACKE_free( b_t );
exit_level_1:
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_clacp2_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_clacp2_work", info );
}
return info;
}
示例9: LAPACKE_ssfrk_work
lapack_int LAPACKE_ssfrk_work( int matrix_order, char transr, char uplo,
char trans, lapack_int n, lapack_int k,
float alpha, const float* a, lapack_int lda,
float beta, float* c )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_ssfrk( &transr, &uplo, &trans, &n, &k, &alpha, a, &lda, &beta,
c );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int na = LAPACKE_lsame( trans, 'n' ) ? n : k;
lapack_int ka = LAPACKE_lsame( trans, 'n' ) ? k : n;
lapack_int lda_t = MAX(1,na);
float* a_t = NULL;
float* c_t = NULL;
/* Check leading dimension(s) */
if( lda < ka ) {
info = -9;
LAPACKE_xerbla( "LAPACKE_ssfrk_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,ka) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
c_t = (float*)
LAPACKE_malloc( sizeof(float) * ( MAX(1,n) * MAX(2,n+1) ) / 2 );
if( c_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_1;
}
/* Transpose input matrices */
LAPACKE_sge_trans( matrix_order, na, ka, a, lda, a_t, lda_t );
LAPACKE_spf_trans( matrix_order, transr, uplo, n, c, c_t );
/* Call LAPACK function and adjust info */
LAPACK_ssfrk( &transr, &uplo, &trans, &n, &k, &alpha, a_t, &lda_t,
&beta, c_t );
info = 0; /* LAPACK call is ok! */
/* Transpose output matrices */
LAPACKE_spf_trans( LAPACK_COL_MAJOR, transr, uplo, n, c_t, c );
/* Release memory and exit */
LAPACKE_free( c_t );
exit_level_1:
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_ssfrk_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_ssfrk_work", info );
}
return info;
}
示例10: LAPACKE_sgeqpf_work
lapack_int LAPACKE_sgeqpf_work( int matrix_layout, lapack_int m, lapack_int n,
float* a, lapack_int lda, lapack_int* jpvt,
float* tau, float* work )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_sgeqpf( &m, &n, a, &lda, jpvt, tau, work, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,m);
float* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -5;
LAPACKE_xerbla( "LAPACKE_sgeqpf_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_sge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_sgeqpf( &m, &n, a_t, &lda_t, jpvt, tau, work, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_sge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_sgeqpf_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_sgeqpf_work", info );
}
return info;
}
示例11: LAPACKE_slaswp_work
lapack_int LAPACKE_slaswp_work( int matrix_layout, lapack_int n, float* a,
lapack_int lda, lapack_int k1, lapack_int k2,
const lapack_int* ipiv, lapack_int incx )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_slaswp( &n, a, &lda, &k1, &k2, ipiv, &incx );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,lda);
float* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -4;
LAPACKE_xerbla( "LAPACKE_slaswp_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_sge_trans( matrix_layout, lda, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_slaswp( &n, a_t, &lda_t, &k1, &k2, ipiv, &incx );
info = 0; /* LAPACK call is ok! */
/* Transpose output matrices */
LAPACKE_sge_trans( LAPACK_COL_MAJOR, lda, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_slaswp_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_slaswp_work", info );
}
return info;
}
示例12: LAPACKE_stfttr_work
lapack_int LAPACKE_stfttr_work( int matrix_order, char transr, char uplo,
lapack_int n, const float* arf, float* a,
lapack_int lda )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_stfttr( &transr, &uplo, &n, arf, a, &lda, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,n);
float* a_t = NULL;
float* arf_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_stfttr_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
arf_t = (float*)
LAPACKE_malloc( sizeof(float) * ( MAX(1,n) * MAX(2,n+1) ) / 2 );
if( arf_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_1;
}
/* Transpose input matrices */
LAPACKE_spf_trans( matrix_order, transr, uplo, n, arf, arf_t );
/* Call LAPACK function and adjust info */
LAPACK_stfttr( &transr, &uplo, &n, arf_t, a_t, &lda_t, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( arf_t );
exit_level_1:
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_stfttr_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_stfttr_work", info );
}
return info;
}
示例13: LAPACKE_shs_trans
void LAPACKE_shs_trans( int matrix_order, lapack_int n,
const float *in, lapack_int ldin,
float *out, lapack_int ldout )
{
if( in == NULL || out == NULL ) return;
/* Convert subdiagonal first */
if( matrix_order == LAPACK_COL_MAJOR ) {
LAPACKE_sge_trans( LAPACK_COL_MAJOR, 1, n-1, &in[1], ldin+1,
&out[ldout], ldout+1 );
} else if ( matrix_order == LAPACK_ROW_MAJOR ) {
LAPACKE_sge_trans( LAPACK_ROW_MAJOR, n-1, 1, &in[ldin], ldin+1,
&out[1], ldout+1 );
} else {
return;
}
/* Convert upper triangular. */
LAPACKE_str_trans( matrix_order, 'u', 'n', n, in, ldin, out, ldout);
}
示例14: LAPACKE_spoequ_work
lapack_int LAPACKE_spoequ_work( int matrix_order, lapack_int n, const float* a,
lapack_int lda, float* s, float* scond,
float* amax )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_spoequ( &n, a, &lda, s, scond, amax, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,n);
float* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -4;
LAPACKE_xerbla( "LAPACKE_spoequ_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_sge_trans( matrix_order, n, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_spoequ( &n, a_t, &lda_t, s, scond, amax, &info );
if( info < 0 ) {
info = info - 1;
}
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_spoequ_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_spoequ_work", info );
}
return info;
}
示例15: LAPACKE_slange_work
float LAPACKE_slange_work( int matrix_layout, char norm, lapack_int m,
lapack_int n, const float* a, lapack_int lda,
float* work )
{
lapack_int info = 0;
float res = 0.;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
res = LAPACK_slange( &norm, &m, &n, a, &lda, work );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,m);
float* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -6;
LAPACKE_xerbla( "LAPACKE_slange_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_sge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
res = LAPACK_slange( &norm, &m, &n, a_t, &lda_t, work );
info = 0; /* LAPACK call is ok! */
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_slange_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_slange_work", info );
}
return res;
}