aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjulie <julielangou@users.noreply.github.com>2015-10-22 05:29:34 +0000
committerjulie <julielangou@users.noreply.github.com>2015-10-22 05:29:34 +0000
commit56a076911e04ba0c6e64a071b89ae5853d78f96d (patch)
treeaf36fd91ae842ab2dc1f22384588eeacd499113b
parent6d3c6b3d719c4fa38f8321e398a8ab142c124f22 (diff)
Fix bug 137 and 138 submitted by Dan Kortschak
Applied patch submitted by Dan Kortschak
-rw-r--r--LAPACKE/src/lapacke_clantr.c2
-rw-r--r--LAPACKE/src/lapacke_clantr_work.c6
-rw-r--r--LAPACKE/src/lapacke_dlantr.c2
-rw-r--r--LAPACKE/src/lapacke_dlantr_work.c6
-rw-r--r--LAPACKE/src/lapacke_slantr.c2
-rw-r--r--LAPACKE/src/lapacke_slantr_work.c6
-rw-r--r--LAPACKE/src/lapacke_zlantr.c2
-rw-r--r--LAPACKE/src/lapacke_zlantr_work.c6
8 files changed, 16 insertions, 16 deletions
diff --git a/LAPACKE/src/lapacke_clantr.c b/LAPACKE/src/lapacke_clantr.c
index 36ae5972..fe123cf5 100644
--- a/LAPACKE/src/lapacke_clantr.c
+++ b/LAPACKE/src/lapacke_clantr.c
@@ -53,7 +53,7 @@ float LAPACKE_clantr( int matrix_layout, char norm, char uplo, char diag,
/* Allocate memory for working array(s) */
if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
LAPACKE_lsame( norm, 'O' ) ) {
- work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,m) );
+ work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,MAX(m,n)) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
diff --git a/LAPACKE/src/lapacke_clantr_work.c b/LAPACKE/src/lapacke_clantr_work.c
index 2ac7e88c..5c4ba5ec 100644
--- a/LAPACKE/src/lapacke_clantr_work.c
+++ b/LAPACKE/src/lapacke_clantr_work.c
@@ -47,7 +47,7 @@ float LAPACKE_clantr_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_float* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
@@ -57,13 +57,13 @@ float LAPACKE_clantr_work( int matrix_layout, char norm, char uplo,
}
/* Allocate memory for temporary array(s) */
a_t = (lapack_complex_float*)
- LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
+ LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,MAX(m,n)) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
- LAPACKE_ctr_trans( matrix_layout, uplo, diag, n, a, lda, a_t, lda_t );
+ LAPACKE_ctr_trans( matrix_layout, uplo, diag, MAX(m,n), a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
res = LAPACK_clantr( &norm, &uplo, &diag, &m, &n, a_t, &lda_t, work );
info = 0; /* LAPACK call is ok! */
diff --git a/LAPACKE/src/lapacke_dlantr.c b/LAPACKE/src/lapacke_dlantr.c
index 7ac947f0..9f66725e 100644
--- a/LAPACKE/src/lapacke_dlantr.c
+++ b/LAPACKE/src/lapacke_dlantr.c
@@ -53,7 +53,7 @@ double LAPACKE_dlantr( int matrix_layout, char norm, char uplo, char diag,
/* Allocate memory for working array(s) */
if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
LAPACKE_lsame( norm, 'O' ) ) {
- work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,m) );
+ work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,MAX(m,n)) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
diff --git a/LAPACKE/src/lapacke_dlantr_work.c b/LAPACKE/src/lapacke_dlantr_work.c
index e390c18d..ccd37f25 100644
--- a/LAPACKE/src/lapacke_dlantr_work.c
+++ b/LAPACKE/src/lapacke_dlantr_work.c
@@ -46,7 +46,7 @@ double LAPACKE_dlantr_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);
double* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
@@ -55,13 +55,13 @@ double LAPACKE_dlantr_work( int matrix_layout, char norm, char uplo,
return info;
}
/* Allocate memory for temporary array(s) */
- a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,n) );
+ a_t = (double*)LAPACKE_malloc( sizeof(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_dtr_trans( matrix_layout, uplo, diag, n, a, lda, a_t, lda_t );
+ LAPACKE_dtr_trans( matrix_layout, uplo, diag, MAX(m,n), a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
res = LAPACK_dlantr( &norm, &uplo, &diag, &m, &n, a_t, &lda_t, work );
info = 0; /* LAPACK call is ok! */
diff --git a/LAPACKE/src/lapacke_slantr.c b/LAPACKE/src/lapacke_slantr.c
index 6952bd93..daa4bcac 100644
--- a/LAPACKE/src/lapacke_slantr.c
+++ b/LAPACKE/src/lapacke_slantr.c
@@ -53,7 +53,7 @@ float LAPACKE_slantr( int matrix_layout, char norm, char uplo, char diag,
/* Allocate memory for working array(s) */
if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
LAPACKE_lsame( norm, 'O' ) ) {
- work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,m) );
+ work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,MAX(m,n)) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
diff --git a/LAPACKE/src/lapacke_slantr_work.c b/LAPACKE/src/lapacke_slantr_work.c
index 6f5c0ada..75a33f18 100644
--- a/LAPACKE/src/lapacke_slantr_work.c
+++ b/LAPACKE/src/lapacke_slantr_work.c
@@ -46,7 +46,7 @@ float LAPACKE_slantr_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);
float* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
@@ -55,13 +55,13 @@ float LAPACKE_slantr_work( int matrix_layout, char norm, char uplo,
return info;
}
/* Allocate memory for temporary array(s) */
- a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
+ a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,MAX(m,n)) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Transpose input matrices */
- LAPACKE_str_trans( matrix_layout, uplo, diag, n, a, lda, a_t, lda_t );
+ LAPACKE_str_trans( matrix_layout, uplo, diag, MAX(m,n), a, lda, a_t, lda_t );
/* Call LAPACK function and adjust info */
res = LAPACK_slantr( &norm, &uplo, &diag, &m, &n, a_t, &lda_t, work );
info = 0; /* LAPACK call is ok! */
diff --git a/LAPACKE/src/lapacke_zlantr.c b/LAPACKE/src/lapacke_zlantr.c
index 37b40540..65339a58 100644
--- a/LAPACKE/src/lapacke_zlantr.c
+++ b/LAPACKE/src/lapacke_zlantr.c
@@ -53,7 +53,7 @@ double LAPACKE_zlantr( int matrix_layout, char norm, char uplo, char diag,
/* Allocate memory for working array(s) */
if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
LAPACKE_lsame( norm, 'O' ) ) {
- work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,m) );
+ work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,MAX(m,n)) );
if( work == NULL ) {
info = LAPACK_WORK_MEMORY_ERROR;
goto exit_level_0;
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! */