本文整理汇总了C++中LAPACKE_dge_trans函数的典型用法代码示例。如果您正苦于以下问题:C++ LAPACKE_dge_trans函数的具体用法?C++ LAPACKE_dge_trans怎么用?C++ LAPACKE_dge_trans使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LAPACKE_dge_trans函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LAPACKE_dlacpy_work
lapack_int LAPACKE_dlacpy_work( int matrix_order, char uplo, lapack_int m,
lapack_int n, const double* a, lapack_int lda,
double* b, lapack_int ldb )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dlacpy( &uplo, &m, &n, a, &lda, b, &ldb );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,m);
lapack_int ldb_t = MAX(1,m);
double* a_t = NULL;
double* b_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -6;
LAPACKE_xerbla( "LAPACKE_dlacpy_work", info );
return info;
}
if( ldb < n ) {
info = -8;
LAPACKE_xerbla( "LAPACKE_dlacpy_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
b_t = (double*)LAPACKE_malloc( sizeof(double) * ldb_t * MAX(1,n) );
if( b_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_1;
}
/* Transpose input matrices */
LAPACKE_dge_trans( matrix_order, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_dlacpy( &uplo, &m, &n, a_t, &lda_t, b_t, &ldb_t );
info = 0; /* LAPACK call is ok! */
/* Transpose output matrices */
LAPACKE_dge_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_dlacpy_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dlacpy_work", info );
}
return info;
}
示例2: LAPACKE_dgebal_work
lapack_int LAPACKE_dgebal_work( int matrix_order, char job, lapack_int n,
double* a, lapack_int lda, lapack_int* ilo,
lapack_int* ihi, double* scale )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dgebal( &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);
double* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -5;
LAPACKE_xerbla( "LAPACKE_dgebal_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 = (double*)LAPACKE_malloc( sizeof(double) * 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_dge_trans( matrix_order, n, n, a, lda, a_t, lda_t );
}
/* Call LAPACK function and adjust info */
LAPACK_dgebal( &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_dge_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_dgebal_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dgebal_work", info );
}
return info;
}
示例3: LAPACKE_dtptrs_work
lapack_int LAPACKE_dtptrs_work( int matrix_order, char uplo, char trans,
char diag, lapack_int n, lapack_int nrhs,
const double* ap, double* b, lapack_int ldb )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dtptrs( &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);
double* b_t = NULL;
double* ap_t = NULL;
/* Check leading dimension(s) */
if( ldb < nrhs ) {
info = -9;
LAPACKE_xerbla( "LAPACKE_dtptrs_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
b_t = (double*)LAPACKE_malloc( sizeof(double) * ldb_t * MAX(1,nrhs) );
if( b_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
ap_t = (double*)
LAPACKE_malloc( sizeof(double) * ( 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_dge_trans( matrix_order, n, nrhs, b, ldb, b_t, ldb_t );
LAPACKE_dtp_trans( matrix_order, uplo, diag, n, ap, ap_t );
/* Call LAPACK function and adjust info */
LAPACK_dtptrs( &uplo, &trans, &diag, &n, &nrhs, ap_t, b_t, &ldb_t,
&info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_dge_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_dtptrs_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dtptrs_work", info );
}
return info;
}
示例4: LAPACKE_dsyevd_work
lapack_int LAPACKE_dsyevd_work( int matrix_order, char jobz, char uplo,
lapack_int n, double* a, lapack_int lda,
double* w, double* work, lapack_int lwork,
lapack_int* iwork, lapack_int liwork )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dsyevd( &jobz, &uplo, &n, a, &lda, w, work, &lwork, iwork,
&liwork, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,n);
double* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -6;
LAPACKE_xerbla( "LAPACKE_dsyevd_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
if( liwork == -1 || lwork == -1 ) {
LAPACK_dsyevd( &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 = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_dge_trans( matrix_order, n, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_dsyevd( &jobz, &uplo, &n, a_t, &lda_t, w, work, &lwork, iwork,
&liwork, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_dge_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_dsyevd_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dsyevd_work", info );
}
return info;
}
示例5: LAPACKE_dorgrq_work
lapack_int LAPACKE_dorgrq_work( int matrix_layout, lapack_int m, lapack_int n,
lapack_int k, double* a, lapack_int lda,
const double* tau, double* work,
lapack_int lwork )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dorgrq( &m, &n, &k, a, &lda, tau, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,m);
double* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -6;
LAPACKE_xerbla( "LAPACKE_dorgrq_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_dorgrq( &m, &n, &k, a, &lda_t, tau, work, &lwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_dge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_dorgrq( &m, &n, &k, a_t, &lda_t, tau, work, &lwork, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_dge_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_dorgrq_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dorgrq_work", info );
}
return info;
}
示例6: LAPACKE_dgttrs_work
lapack_int LAPACKE_dgttrs_work( int matrix_layout, char trans, lapack_int n,
lapack_int nrhs, const double* dl,
const double* d, const double* du,
const double* du2, const lapack_int* ipiv,
double* b, lapack_int ldb )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dgttrs( &trans, &n, &nrhs, dl, d, du, du2, ipiv, b, &ldb,
&info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int ldb_t = MAX(1,n);
double* b_t = NULL;
/* Check leading dimension(s) */
if( ldb < nrhs ) {
info = -11;
LAPACKE_xerbla( "LAPACKE_dgttrs_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
b_t = (double*)LAPACKE_malloc( sizeof(double) * ldb_t * MAX(1,nrhs) );
if( b_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_dge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
/* Call LAPACK function and adjust info */
LAPACK_dgttrs( &trans, &n, &nrhs, dl, d, du, du2, ipiv, b_t, &ldb_t,
&info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_dge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
/* Release memory and exit */
LAPACKE_free( b_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dgttrs_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dgttrs_work", info );
}
return info;
}
示例7: LAPACKE_dlascl_work
lapack_int LAPACKE_dlascl_work( int matrix_layout, char type, lapack_int kl,
lapack_int ku, double cfrom, double cto,
lapack_int m, lapack_int n, double* a,
lapack_int lda )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dlascl( &type, &kl, &ku, &cfrom, &cto, &m, &n, a, &lda, &info);
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int nrows_a = LAPACKE_lsame(type, 'b') ? kl + 1 :
LAPACKE_lsame(type, 'q') ? ku + 1 :
LAPACKE_lsame(type, 'z') ? 2 * kl + ku + 1 : m;
lapack_int lda_t = MAX(1,nrows_a);
double* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -9;
LAPACKE_xerbla( "LAPACKE_dlascl_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_dge_trans( matrix_layout, nrows_a, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_dlascl( &type, &kl, &ku, &cfrom, &cto, &m, &n, a_t, &lda_t, &info);
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_dge_trans( LAPACK_COL_MAJOR, nrows_a, 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_dlascl_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dlascl_work", info );
}
return info;
}
示例8: LAPACKE_dggbak_work
lapack_int LAPACKE_dggbak_work( int matrix_order, char job, char side,
lapack_int n, lapack_int ilo, lapack_int ihi,
const double* lscale, const double* rscale,
lapack_int m, double* v, lapack_int ldv )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dggbak( &job, &side, &n, &ilo, &ihi, lscale, rscale, &m, v, &ldv,
&info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int ldv_t = MAX(1,n);
double* v_t = NULL;
/* Check leading dimension(s) */
if( ldv < m ) {
info = -11;
LAPACKE_xerbla( "LAPACKE_dggbak_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
v_t = (double*)LAPACKE_malloc( sizeof(double) * ldv_t * MAX(1,m) );
if( v_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_dge_trans( matrix_order, n, m, v, ldv, v_t, ldv_t );
/* Call LAPACK function and adjust info */
LAPACK_dggbak( &job, &side, &n, &ilo, &ihi, lscale, rscale, &m, v_t,
&ldv_t, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_dge_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_dggbak_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dggbak_work", info );
}
return info;
}
示例9: LAPACKE_dpteqr_work
lapack_int LAPACKE_dpteqr_work( int matrix_order, char compz, lapack_int n,
double* d, double* e, double* z, lapack_int ldz,
double* work )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dpteqr( &compz, &n, d, e, z, &ldz, work, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int ldz_t = MAX(1,n);
double* z_t = NULL;
/* Check leading dimension(s) */
if( ldz < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_dpteqr_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
z_t = (double*)LAPACKE_malloc( sizeof(double) * 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_dge_trans( matrix_order, n, n, z, ldz, z_t, ldz_t );
}
/* Call LAPACK function and adjust info */
LAPACK_dpteqr( &compz, &n, d, e, z_t, &ldz_t, work, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_dge_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_dpteqr_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dpteqr_work", info );
}
return info;
}
示例10: LAPACKE_dsfrk_work
lapack_int LAPACKE_dsfrk_work( 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 info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dsfrk( &transr, &uplo, &trans, &n, &k, &alpha, a, &lda, &beta,
c );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == 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);
double* a_t = NULL;
double* c_t = NULL;
/* Check leading dimension(s) */
if( lda < ka ) {
info = -9;
LAPACKE_xerbla( "LAPACKE_dsfrk_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,ka) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
c_t = (double*)
LAPACKE_malloc( sizeof(double) * ( 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_dge_trans( matrix_layout, na, ka, a, lda, a_t, lda_t );
LAPACKE_dpf_trans( matrix_layout, transr, uplo, n, c, c_t );
/* Call LAPACK function and adjust info */
LAPACK_dsfrk( &transr, &uplo, &trans, &n, &k, &alpha, a_t, &lda_t,
&beta, c_t );
info = 0; /* LAPACK call is ok! */
/* Transpose output matrices */
LAPACKE_dpf_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_dsfrk_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dsfrk_work", info );
}
return info;
}
示例11: LAPACKE_dstevd_work
lapack_int LAPACKE_dstevd_work( int matrix_layout, char jobz, lapack_int n,
double* d, double* e, double* z, lapack_int ldz,
double* 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_dstevd( &jobz, &n, d, e, z, &ldz, work, &lwork, iwork, &liwork,
&info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int ldz_t = MAX(1,n);
double* z_t = NULL;
/* Check leading dimension(s) */
if( ldz < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_dstevd_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
if( liwork == -1 || lwork == -1 ) {
LAPACK_dstevd( &jobz, &n, d, e, z, &ldz_t, work, &lwork, iwork,
&liwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
if( LAPACKE_lsame( jobz, 'v' ) ) {
z_t = (double*)LAPACKE_malloc( sizeof(double) * ldz_t * MAX(1,n) );
if( z_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
}
/* Call LAPACK function and adjust info */
LAPACK_dstevd( &jobz, &n, d, e, z_t, &ldz_t, work, &lwork, iwork,
&liwork, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
if( LAPACKE_lsame( jobz, 'v' ) ) {
LAPACKE_dge_trans( LAPACK_COL_MAJOR, n, n, z_t, ldz_t, z, ldz );
}
/* Release memory and exit */
if( LAPACKE_lsame( jobz, 'v' ) ) {
LAPACKE_free( z_t );
}
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dstevd_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dstevd_work", info );
}
return info;
}
示例12: LAPACKE_dgeqpf_work
lapack_int LAPACKE_dgeqpf_work( int matrix_order, lapack_int m, lapack_int n,
double* a, lapack_int lda, lapack_int* jpvt,
double* tau, double* work )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dgeqpf( &m, &n, a, &lda, jpvt, tau, work, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,m);
double* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -5;
LAPACKE_xerbla( "LAPACKE_dgeqpf_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_dge_trans( matrix_order, m, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_dgeqpf( &m, &n, a_t, &lda_t, jpvt, tau, work, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_dge_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_dgeqpf_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dgeqpf_work", info );
}
return info;
}
示例13: LAPACKE_dlarfx_work
lapack_int LAPACKE_dlarfx_work( int matrix_order, char side, lapack_int m,
lapack_int n, const double* v, double tau,
double* c, lapack_int ldc, double* work )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dlarfx( &side, &m, &n, v, &tau, c, &ldc, work );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int ldc_t = MAX(1,m);
double* c_t = NULL;
/* Check leading dimension(s) */
if( ldc < n ) {
info = -8;
LAPACKE_xerbla( "LAPACKE_dlarfx_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
c_t = (double*)LAPACKE_malloc( sizeof(double) * ldc_t * MAX(1,n) );
if( c_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
LAPACKE_dge_trans( matrix_order, m, n, c, ldc, c_t, ldc_t );
/* Call LAPACK function and adjust info */
LAPACK_dlarfx( &side, &m, &n, v, &tau, c_t, &ldc_t, work );
info = 0; /* LAPACK call is ok! */
/* Transpose output matrices */
LAPACKE_dge_trans( LAPACK_COL_MAJOR, m, n, c_t, ldc_t, c, ldc );
/* Release memory and exit */
LAPACKE_free( c_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dlarfx_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dlarfx_work", info );
}
return info;
}
示例14: LAPACKE_dopgtr_work
lapack_int LAPACKE_dopgtr_work( int matrix_order, char uplo, lapack_int n,
const double* ap, const double* tau, double* q,
lapack_int ldq, double* work )
{
lapack_int info = 0;
lapack_int ldq_t;
double *q_t = NULL, *ap_t = NULL;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dopgtr( &uplo, &n, ap, tau, q, &ldq, work, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
ldq_t = MAX(1,n);
/* Check leading dimension(s) */
if( ldq < n ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_dopgtr_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
q_t = (double*)LAPACKE_malloc( sizeof(double) * ldq_t * MAX(1,n) );
if( q_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
ap_t = (double*)
LAPACKE_malloc( sizeof(double) * ( 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_dsp_trans( matrix_order, uplo, n, ap, ap_t );
/* Call LAPACK function and adjust info */
LAPACK_dopgtr( &uplo, &n, ap_t, tau, q_t, &ldq_t, work, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_dge_trans( LAPACK_COL_MAJOR, n, n, q_t, ldq_t, q, ldq );
/* Release memory and exit */
LAPACKE_free( ap_t );
exit_level_1:
LAPACKE_free( q_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dopgtr_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dopgtr_work", info );
}
return info;
}
示例15: LAPACKE_dtrttf_work
lapack_int LAPACKE_dtrttf_work( int matrix_order, char transr, char uplo,
lapack_int n, const double* a, lapack_int lda,
double* arf )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dtrttf( &transr, &uplo, &n, a, &lda, arf, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,n);
double* a_t = NULL;
double* arf_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -6;
LAPACKE_xerbla( "LAPACKE_dtrttf_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
arf_t = (double*)
LAPACKE_malloc( sizeof(double) * ( 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_dge_trans( matrix_order, n, n, a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
LAPACK_dtrttf( &transr, &uplo, &n, a_t, &lda_t, arf_t, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_dpf_trans( LAPACK_COL_MAJOR, transr, uplo, n, arf_t, arf );
/* 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_dtrttf_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dtrttf_work", info );
}
return info;
}