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,