Bug in [CZ]TREVC3: incorrect results

Post here if you want to report a bug to the LAPACK team

Bug in [CZ]TREVC3: incorrect results

Postby chereshnev » Mon Aug 29, 2016 12:28 am

CTREVC3 and ZTREVC3 routines contain bug in call to GEMM. They pass real type ALPHA instead of complex type and GEMM uses some random value from memory as imaginary part. The fix is simple:

Code: Select all
Index: ztrevc3.f
===================================================================
--- ztrevc3.f   (revision 1776)
+++ ztrevc3.f   (working copy)
@@ -593,7 +593,7 @@
 *              When the number of vectors stored reaches NB,
 *              or if this was last vector, do the GEMM
                IF( (IV.EQ.NB) .OR. (KI.EQ.N) ) THEN
-                  CALL ZGEMM( 'N', 'N', N, IV, N-KI+IV, ONE,
+                  CALL ZGEMM( 'N', 'N', N, IV, N-KI+IV, CONE,
      $                        VL( 1, KI-IV+1 ), LDVL,
      $                        WORK( KI-IV+1 + (1)*N ), N,
      $                        CZERO,
Index: ctrevc3.f
===================================================================
--- ctrevc3.f   (revision 1776)
+++ ctrevc3.f   (working copy)
@@ -593,7 +593,7 @@
 *              When the number of vectors stored reaches NB,
 *              or if this was last vector, do the GEMM
                IF( (IV.EQ.NB) .OR. (KI.EQ.N) ) THEN
-                  CALL CGEMM( 'N', 'N', N, IV, N-KI+IV, ONE,
+                  CALL CGEMM( 'N', 'N', N, IV, N-KI+IV, CONE,
      $                        VL( 1, KI-IV+1 ), LDVL,
      $                        WORK( KI-IV+1 + (1)*N ), N,
      $                        CZERO,
chereshnev
 
Posts: 14
Joined: Thu Oct 09, 2014 6:17 am
Location: Intel Corp., Russia, Novosibirsk

Re: Bug in [CZ]TREVC3: incorrect results

Postby Julien Langou » Mon Aug 29, 2016 1:45 am

Eugene, this is great! This helps a lot. Thanks for your contribution. We will be integrating this very soon. I have just checked and this bug fix clearly helps a lot in having a correct code. Thanks! Cheers, Julien.
Julien Langou
 
Posts: 826
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA


Return to Bug report

Who is online

Users browsing this forum: No registered users and 2 guests