aboutsummaryrefslogtreecommitdiff
path: root/LAPACKE/src/lapacke_zlantr_work.c
diff options
context:
space:
mode:
Diffstat (limited to 'LAPACKE/src/lapacke_zlantr_work.c')
-rw-r--r--LAPACKE/src/lapacke_zlantr_work.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/LAPACKE/src/lapacke_zlantr_work.c b/LAPACKE/src/lapacke_zlantr_work.c
index e9f00361..3a924de8 100644
--- a/LAPACKE/src/lapacke_zlantr_work.c
+++ b/LAPACKE/src/lapacke_zlantr_work.c
@@ -47,7 +47,7 @@ double LAPACKE_zlantr_work( int matrix_layout, char norm, char uplo,
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
- lapack_int lda_t = MAX(1,n);
+ lapack_int lda_t = MAX(1,m);
lapack_complex_double* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
@@ -57,13 +57,13 @@ double LAPACKE_zlantr_work( int matrix_layout, char norm, char uplo,
}
/* Allocate memory for temporary array(s) */
a_t = (lapack_complex_double*)
- LAPACKE_malloc( sizeof(lapack_complex_double) * lda_t * MAX(1,n) );
+ LAPACKE_malloc( sizeof(lapack_complex_double) * lda_t * MAX(1,MAX(m,n)) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
- LAPACKE_ztr_trans( matrix_layout, uplo, diag, n, a, lda, a_t, lda_t );
+ LAPACKE_ztr_trans( matrix_layout, uplo, diag, MAX(m,n), a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
res = LAPACK_zlantr( &norm, &uplo, &diag, &m, &n, a_t, &lda_t, work );
info = 0; /* LAPACK call is ok! */