summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlangou <langou@users.noreply.github.com>2015-12-10 02:42:34 +0000
committerlangou <langou@users.noreply.github.com>2015-12-10 02:42:34 +0000
commitf20edd07ecec68cc10daa0be41ecd07594fba7c2 (patch)
tree9ff777e7c42668f3bf2aec2b1f23ba83a9005a74
parent63f6a1729d61504687b48481c1f5e065af897fa4 (diff)
downloadlapack-f20edd07ecec68cc10daa0be41ecd07594fba7c2.tar.gz
lapack-f20edd07ecec68cc10daa0be41ecd07594fba7c2.tar.bz2
lapack-f20edd07ecec68cc10daa0be41ecd07594fba7c2.zip
Bug reported by Tracey Brendan. Thanks Tracey.
See: http://icl.cs.utk.edu/lapack-forum/viewtopic.php?t=4862
-rw-r--r--LAPACKE/src/lapacke_cunmlq_work.c9
-rw-r--r--LAPACKE/src/lapacke_dormlq_work.c6
-rw-r--r--LAPACKE/src/lapacke_sormlq_work.c6
-rw-r--r--LAPACKE/src/lapacke_zunmlq_work.c9
4 files changed, 24 insertions, 6 deletions
diff --git a/LAPACKE/src/lapacke_cunmlq_work.c b/LAPACKE/src/lapacke_cunmlq_work.c
index b79a4f93..3e4226a8 100644
--- a/LAPACKE/src/lapacke_cunmlq_work.c
+++ b/LAPACKE/src/lapacke_cunmlq_work.c
@@ -74,8 +74,13 @@ lapack_int LAPACKE_cunmlq_work( int matrix_layout, char side, char trans,
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
- a_t = (lapack_complex_float*)
- LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,m) );
+ if( LAPACKE_lsame( side, 'l' ) ) {
+ a_t = (lapack_complex_float*)
+ LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,m) );
+ } else {
+ a_t = (lapack_complex_float*)
+ LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
+ }
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
diff --git a/LAPACKE/src/lapacke_dormlq_work.c b/LAPACKE/src/lapacke_dormlq_work.c
index 8f3d32c0..f46c6d3b 100644
--- a/LAPACKE/src/lapacke_dormlq_work.c
+++ b/LAPACKE/src/lapacke_dormlq_work.c
@@ -72,7 +72,11 @@ lapack_int LAPACKE_dormlq_work( int matrix_layout, char side, char trans,
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
- a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,m) );
+ if( LAPACKE_lsame( side, 'l' ) ) {
+ a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,m) );
+ } else {
+ 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;
diff --git a/LAPACKE/src/lapacke_sormlq_work.c b/LAPACKE/src/lapacke_sormlq_work.c
index a277436c..b02a2d10 100644
--- a/LAPACKE/src/lapacke_sormlq_work.c
+++ b/LAPACKE/src/lapacke_sormlq_work.c
@@ -72,7 +72,11 @@ lapack_int LAPACKE_sormlq_work( int matrix_layout, char side, char trans,
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
- a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,m) );
+ if( LAPACKE_lsame( side, 'l' ) ) {
+ a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,m) );
+ } else {
+ 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;
diff --git a/LAPACKE/src/lapacke_zunmlq_work.c b/LAPACKE/src/lapacke_zunmlq_work.c
index 08d86ce6..d75224b2 100644
--- a/LAPACKE/src/lapacke_zunmlq_work.c
+++ b/LAPACKE/src/lapacke_zunmlq_work.c
@@ -74,8 +74,13 @@ lapack_int LAPACKE_zunmlq_work( int matrix_layout, char side, char trans,
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
- a_t = (lapack_complex_double*)
- LAPACKE_malloc( sizeof(lapack_complex_double) * lda_t * MAX(1,m) );
+ if( LAPACKE_lsame( side, 'l' ) ) {
+ a_t = (lapack_complex_double*)
+ LAPACKE_malloc( sizeof(lapack_complex_double) * lda_t * MAX(1,m) );
+ } else {
+ a_t = (lapack_complex_double*)
+ LAPACKE_malloc( sizeof(lapack_complex_double) * lda_t * MAX(1,n) );
+ }
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;