LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
 All Classes Files Functions Variables Typedefs Macros
lapacke_zlarft_work.c File Reference
#include "lapacke_utils.h"
Include dependency graph for lapacke_zlarft_work.c:

Go to the source code of this file.

Functions/Subroutines

lapack_int LAPACKE_zlarft_work (int matrix_order, char direct, char storev, lapack_int n, lapack_int k, const lapack_complex_double *v, lapack_int ldv, const lapack_complex_double *tau, lapack_complex_double *t, lapack_int ldt)

Function/Subroutine Documentation

lapack_int LAPACKE_zlarft_work ( int  matrix_order,
char  direct,
char  storev,
lapack_int  n,
lapack_int  k,
const lapack_complex_double v,
lapack_int  ldv,
const lapack_complex_double tau,
lapack_complex_double t,
lapack_int  ldt 
)

Definition at line 36 of file lapacke_zlarft_work.c.

{
lapack_int info = 0;
lapack_int nrows_v, ncols_v;
lapack_int ldt_t, ldv_t;
lapack_complex_double *v_t = NULL, *t_t = NULL;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_zlarft( &direct, &storev, &n, &k, v, &ldv, tau, t, &ldt );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
nrows_v = LAPACKE_lsame( storev, 'c' ) ? n :
( LAPACKE_lsame( storev, 'r' ) ? k : 1);
ncols_v = LAPACKE_lsame( storev, 'c' ) ? k :
( LAPACKE_lsame( storev, 'r' ) ? n : 1);
ldt_t = MAX(1,k);
ldv_t = MAX(1,nrows_v);
/* Check leading dimension(s) */
if( ldt < k ) {
info = -10;
LAPACKE_xerbla( "LAPACKE_zlarft_work", info );
return info;
}
if( ldv < ncols_v ) {
info = -7;
LAPACKE_xerbla( "LAPACKE_zlarft_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
ldv_t * MAX(1,ncols_v) );
if( v_t == NULL ) {
goto exit_level_0;
}
LAPACKE_malloc( sizeof(lapack_complex_double) * ldt_t * MAX(1,k) );
if( t_t == NULL ) {
goto exit_level_1;
}
/* Transpose input matrices */
LAPACKE_zge_trans( matrix_order, nrows_v, ncols_v, v, ldv, v_t, ldv_t );
/* Call LAPACK function and adjust info */
LAPACK_zlarft( &direct, &storev, &n, &k, v_t, &ldv_t, tau, t_t,
&ldt_t );
info = 0; /* LAPACK call is ok! */
/* Transpose output matrices */
LAPACKE_zge_trans( LAPACK_COL_MAJOR, k, k, t_t, ldt_t, t, ldt );
/* Release memory and exit */
LAPACKE_free( t_t );
exit_level_1:
LAPACKE_free( v_t );
exit_level_0:
LAPACKE_xerbla( "LAPACKE_zlarft_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_zlarft_work", info );
}
return info;
}

Here is the call graph for this function:

Here is the caller graph for this function: