Fix workspace computation for side=L

From netlib PR#144
This commit is contained in:
Martin Kroeker 2017-05-04 20:01:41 +02:00 committed by GitHub
parent 4beffaaa4b
commit d5ea8fd823
1 changed files with 4 additions and 1 deletions

View File

@ -43,6 +43,7 @@ lapack_int LAPACKE_ztpmqrt( int matrix_layout, char side, char trans,
{
lapack_int ncols_a, nrows_a;
lapack_int nrows_v;
lapack_int lwork;
lapack_int info = 0;
lapack_complex_double* work = NULL;
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
@ -71,8 +72,10 @@ lapack_int LAPACKE_ztpmqrt( int matrix_layout, char side, char trans,
}
#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 = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * MAX(1,m) * MAX(1,nb) );
LAPACKE_malloc( sizeof(lapack_complex_double) * lwork );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;