Quick and dirty bug fix.
authorlangou <langou@users.noreply.github.com>
Tue, 6 Oct 2015 02:11:30 +0000 (02:11 +0000)
committerlangou <langou@users.noreply.github.com>
Tue, 6 Oct 2015 02:11:30 +0000 (02:11 +0000)
Bug report and bug fix from Dan Kortschak.

See:
http://icl.cs.utk.edu/lapack-forum/viewtopic.php?t=4810
https://github.com/xianyi/OpenBLAS/issues/642

This is a quick bug fix, this only checks the triangular part of the trapezoid,
the rectangular part is not checked. Another commit should follow up soon.

LAPACKE/src/lapacke_clantr.c
LAPACKE/src/lapacke_dlantr.c
LAPACKE/src/lapacke_slantr.c
LAPACKE/src/lapacke_zlantr.c

index 7ca4c09..36ae597 100644 (file)
@@ -46,7 +46,7 @@ float LAPACKE_clantr( int matrix_layout, char norm, char uplo, char diag,
     }
 #ifndef LAPACK_DISABLE_NAN_CHECK
     /* Optionally check input matrices for NaNs */
-    if( LAPACKE_ctr_nancheck( matrix_layout, uplo, diag, n, a, lda ) ) {
+    if( LAPACKE_ctr_nancheck( matrix_layout, uplo, diag, MIN(m,n), a, lda ) ) {
         return -7;
     }
 #endif
index 2ca5905..7ac947f 100644 (file)
@@ -46,7 +46,7 @@ double LAPACKE_dlantr( int matrix_layout, char norm, char uplo, char diag,
     }
 #ifndef LAPACK_DISABLE_NAN_CHECK
     /* Optionally check input matrices for NaNs */
-    if( LAPACKE_dtr_nancheck( matrix_layout, uplo, diag, n, a, lda ) ) {
+    if( LAPACKE_dtr_nancheck( matrix_layout, uplo, diag, MIN(m,n), a, lda ) ) {
         return -7;
     }
 #endif
index 644ed86..6952bd9 100644 (file)
@@ -46,7 +46,7 @@ float LAPACKE_slantr( int matrix_layout, char norm, char uplo, char diag,
     }
 #ifndef LAPACK_DISABLE_NAN_CHECK
     /* Optionally check input matrices for NaNs */
-    if( LAPACKE_str_nancheck( matrix_layout, uplo, diag, n, a, lda ) ) {
+    if( LAPACKE_str_nancheck( matrix_layout, uplo, diag, MIN(m,n), a, lda ) ) {
         return -7;
     }
 #endif
index 186a1aa..37b4054 100644 (file)
@@ -46,7 +46,7 @@ double LAPACKE_zlantr( int matrix_layout, char norm, char uplo, char diag,
     }
 #ifndef LAPACK_DISABLE_NAN_CHECK
     /* Optionally check input matrices for NaNs */
-    if( LAPACKE_ztr_nancheck( matrix_layout, uplo, diag, n, a, lda ) ) {
+    if( LAPACKE_ztr_nancheck( matrix_layout, uplo, diag, MIN(m,n), a, lda ) ) {
         return -7;
     }
 #endif